Event-Based Library for Arduino - .Net ClientAPI
|
Protocol implementation for AdvancedSerial. More...
Inherited by ebl_arduino.AdvancedSerialClient.
Classes | |
class | AdvancedSerialMessage |
Message class. More... | |
Public Types | |
enum | MessageTypes { DEBUG = 0x01, MESSAGE = 0x02, MESSAGE_ACKNOWLEDGE = 0x03, DISCOVERY_REQUEST = 0x04, DISCOVERY_RESPONSE = 0x05 } |
Type of AdvancedSerial messages. More... | |
enum | ConnectionState { ReadingSTX, ReadingETX, ReadingHeader, ReadingPayload } |
Connection states. More... | |
Public Member Functions | |
delegate void | MessageReceivedCallback (AdvancedSerialMessage Message) |
Delegate method for MessageReceived. | |
abstract bool | IsConnected () |
Verify transport connection. | |
abstract void | Close () |
Close transport connection. | |
void | Send (AdvancedSerialMessage Message) |
Send message. | |
void | Send (MessageTypes Type, byte ID, byte Size, byte[] Payload) |
Send message. | |
void | Send (MessageTypes Type) |
Send simple message without payload. | |
void | Flush () |
Clear communication stream. | |
Public Attributes | |
const int | MESSAGE_HEADER_SIZE = 3 |
Size of message header. | |
const int | MESSAGE_DELIMITER_SIZE = 1 |
Size of message delimiter. | |
const int | MESSAGE_MAX_PAYLOAD_SIZE = 32 |
Maximum size of message payload. | |
const int | MESSAGE_SIZE = MESSAGE_MAX_PAYLOAD_SIZE + MESSAGE_HEADER_SIZE |
Maximum size of message. | |
const byte | STX = 0x02 |
Start of message. | |
const byte | ETX = 0x03 |
End of message. | |
int | MessageTimeout = 2000 |
Timeout for message confirmation. | |
Protected Member Functions | |
void | Receive () |
Receive next amount of data. | |
Protected Attributes | |
Stream | ConnectionStream |
Protocol stream. | |
Events | |
MessageReceivedCallback | MessageReceived |
Occurs when the a message is received. |
Protocol implementation for AdvancedSerial.
abstract void ebl_arduino.SerialProtocol.Close | ( | ) | [pure virtual] |
Close transport connection.
Implemented in ebl_arduino.AdvancedSerialClient.
void ebl_arduino.SerialProtocol.Flush | ( | ) |
Clear communication stream.
abstract bool ebl_arduino.SerialProtocol.IsConnected | ( | ) | [pure virtual] |
Verify transport connection.
Implemented in ebl_arduino.AdvancedSerialClient.
delegate void ebl_arduino.SerialProtocol.MessageReceivedCallback | ( | AdvancedSerialMessage | Message | ) |
Delegate method for MessageReceived.
void ebl_arduino.SerialProtocol.Receive | ( | ) | [protected] |
Receive next amount of data.
void ebl_arduino.SerialProtocol.Send | ( | MessageTypes | Type | ) |
Send simple message without payload.
Type | Message type. |
void ebl_arduino.SerialProtocol.Send | ( | AdvancedSerialMessage | Message | ) |
Send message.
Message | Message to send. |
void ebl_arduino.SerialProtocol.Send | ( | MessageTypes | Type, |
byte | ID, | ||
byte | Size, | ||
byte[] | Payload | ||
) |
Send message.
Type | Message type. |
ID | Message ID. |
Size | Payload size. |
Payload | Message payload |
Stream ebl_arduino.SerialProtocol.ConnectionStream [protected] |
Protocol stream.
const byte ebl_arduino.SerialProtocol.ETX = 0x03 |
End of message.
const int ebl_arduino.SerialProtocol.MESSAGE_DELIMITER_SIZE = 1 |
Size of message delimiter.
const int ebl_arduino.SerialProtocol.MESSAGE_HEADER_SIZE = 3 |
Size of message header.
const int ebl_arduino.SerialProtocol.MESSAGE_MAX_PAYLOAD_SIZE = 32 |
Maximum size of message payload.
Maximum size of message.
int ebl_arduino.SerialProtocol.MessageTimeout = 2000 |
Timeout for message confirmation.
const byte ebl_arduino.SerialProtocol.STX = 0x02 |
Start of message.
MessageReceivedCallback ebl_arduino.SerialProtocol.MessageReceived |
Occurs when the a message is received.