Skip to main content

Interface IDevice<C, P>

Interface to a Brainboxes Device

Assembly: Brainboxes.IO.dll
View Source
Declaration
public interface IDevice<C, P> : IDisposable where C : IConnection where P : IProtocol

Properties

Connection

The connection to this device

View Source
Declaration
C Connection { get; set; }

Protocol

The protocol used to communicate which this device

View Source
Declaration
P Protocol { get; set; }

IsConnected

Whether the Brainboxes Device has an active connection from this connection instance

View Source
Declaration
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
Declaration
bool IsAvailable { get; }

Methods

Connect()

Open Connection to a Brainboxes Device, must be called before SendCommand Throws exception on connection failure

View Source
Declaration
void Connect()

Disconnect()

Disconnect from Brainboxes Device, will be automatically called when class is disposed

View Source
Declaration
void Disconnect()

Events

DeviceStatusChangedEvent

Event called when the status of the device changes, either the IsConnected Property or the IsAvailable property

View Source
Declaration
event DeviceStatusChangedEventHandler<C, P> DeviceStatusChangedEvent
Event Type

Brainboxes.IO.DeviceStatusChangedEventHandler<<C>,<P>>