Helper Class Reference
1.1
HomeGenie - Automation Programs' Engine SDK
|
Serial port helper.
Class instance accessor: SerialPort
More...
Public Member Functions | |
SerialPortHelper | WithName (string port) |
Selects the serial port with the specified name. More... | |
bool | Connect () |
Connect the serial port (@115200bps). More... | |
bool | Connect (int baudRate, StopBits stopBits=StopBits.One, Parity parity=Parity.None) |
Connect the serial port at the specified speed. More... | |
SerialPortHelper | Disconnect () |
Disconnects the serial port. More... | |
void | SendMessage (string message) |
Sends a string message. More... | |
void | SendMessage (byte[] message) |
Sends a raw data message. More... | |
SerialPortHelper | OnStringReceived (Action< string > receivedAction) |
Sets the function to call when a new string message is received. More... | |
SerialPortHelper | OnMessageReceived (Action< byte[]> receivedAction) |
Sets the function to call when a new raw message is received. More... | |
SerialPortHelper | OnStatusChanged (Action< bool > statusChangeAction) |
Sets the function to call when the status of the serial connection changes. More... | |
Properties | |
bool | IsConnected [get] |
Gets a value indicating whether the serial port is connected. More... | |
string | EndOfLine [get, set] |
Gets or sets the end of line delimiter used in text messaging. More... | |
Serial port helper.
Class instance accessor: SerialPort
SerialPortHelper WithName | ( | string | port | ) |
bool Connect | ( | ) |
Connect the serial port (@115200bps).
bool Connect | ( | int | baudRate, |
StopBits | stopBits = StopBits.One , |
||
Parity | parity = Parity.None |
||
) |
Connect the serial port at the specified speed.
baudRate | Baud rate. |
stopBits | Stop Bits. |
parity | Parity. |
SerialPortHelper Disconnect | ( | ) |
Disconnects the serial port.
void SendMessage | ( | string | message | ) |
Sends a string message.
message | Message. |
void SendMessage | ( | byte[] | message | ) |
Sends a raw data message.
message | Message. |
SerialPortHelper OnStringReceived | ( | Action< string > | receivedAction | ) |
Sets the function to call when a new string message is received.
receivedAction | Function or inline delegate. |
SerialPortHelper OnMessageReceived | ( | Action< byte[]> | receivedAction | ) |
Sets the function to call when a new raw message is received.
receivedAction | Function or inline delegate. |
SerialPortHelper OnStatusChanged | ( | Action< bool > | statusChangeAction | ) |
Sets the function to call when the status of the serial connection changes.
statusChangeAction | Function or inline delegate. |
|
get |
Gets a value indicating whether the serial port is connected.
true
if connected; otherwise, false
.
|
getset |
Gets or sets the end of line delimiter used in text messaging.
The end of line.