RRAutoLib.Loconet LoconetService
Namespace: RRAutoLib.Loconet
Assembly: RRAutoLib (in RRAutoLib.dll) Version: 1.4.4714.25322
This service creates a connection to a given serial port and maintains a transmission thread, separate from the calling thread. Events and callbacks are executed on either a pool of worker threads or can be synchronized to a UI thread or any other given thread (see: SyncContext and Packet CallBack's constructor for event and callback synchronization respectively).
There are two transmission queues: a normal and a priority queue. Packets placed in the priority queue preempt the ones in the normal queue. Synchronous and asynchronous transmissions are supported, but in all but a few special situations, the asynchronous methods are prefered, as they don't interfere with time sensitive code, and can partner better with the priority queue system. For asyncronus transmission requests, response packets can be paired with their request counterpart. (see: ReqID, Packet CallBack).
All methods implemented by this class are thread safe.