Interface IDevice<C, P>
Interface to a Brainboxes Device
Assembly: Brainboxes.IO.dll
View Source
public interface IDevice<C, P> : IDisposable where C : IConnection where P : IProtocol
Properties
Connection
The connection to this device
View Source
C Connection { get; set; }
Protocol
The protocol used to communicate which this device
View Source
P Protocol { get; set; }
IsConnected
Whether the Brainboxes Device has an active connection from this connection instance
View Source
bool IsConnected { get; }
IsAvailable
Whether the connection to this Brainboxes Device is available, e.g. online or offline. In case of network TCP connection: this is if the device is pingable on the network. In case of serial connection: this is if the device COM port is listed on the system and not open by another process.
View Source
bool IsAvailable { get; }
Methods
Connect()
Open Connection to a Brainboxes Device, must be called before SendCommand Throws exception on connection failure
View Source
void Connect()
Disconnect()
Disconnect from Brainboxes Device, will be automatically called when class is disposed
View Source
void Disconnect()
Events
DeviceStatusChangedEvent
Event called when the status of the device changes, either the IsConnected Property or the IsAvailable property
View Source
event DeviceStatusChangedEventHandler<C, P> DeviceStatusChangedEvent
Event Type
Brainboxes.IO.DeviceStatusChangedEventHandler<<C>,<P>>