Motion Master
|
Go to the source code of this file.
Classes | |
struct | EthernetMessage |
Structure representing a parsed Ethernet response message. More... | |
class | EthernetDevice |
Handles TCP communication with SOMANET devices over Ethernet. More... | |
Enumerations | |
enum class | EthernetMessageType : uint8_t { SDO_READ = 0x01 , SDO_WRITE = 0x02 , PDO_RXTX_FRAME , PDO_CONTROL = 0x04 , PDO_MAP = 0x05 , FIRMWARE_UPDATE = 0x0B , FILE_READ = 0x0C , FILE_WRITE = 0x0D , STATE_CONTROL , STATE_READ = 0x0F , PARAM_FULL_LIST = 0x13 , SERVER_INFO = 0x20 } |
Enumeration of Ethernet message types used in the protocol. More... | |
enum class | EthernetMessageStatus : uint8_t { OK = 0x00 , FIRST = 0x80 , MIDDLE = 0xC0 , LAST = 0x40 , ERR = 0x28 } |
Represents the status of an Ethernet message during transmission or processing. More... | |
enum class | EthernetSqiReplyStatus : uint8_t { BSY = 0x28 , ACK = 0x58 , ERR = 0x63 } |
Enum class representing the status codes for an Ethernet SQI reply. More... | |
Functions | |
EthernetMessage | parseEthernetMessage (const std::vector< uint8_t > &buffer) |
Parses a raw Ethernet message buffer into a structured EthernetMessage. More... | |
std::vector< uint8_t > | serializeEthernetMessage (const EthernetMessage &message) |
Serializes an EthernetMessage object into a byte buffer. More... | |
|
strong |
Represents the status of an Ethernet message during transmission or processing.
This enum is used to indicate whether a message is complete, part of a segmented sequence, or contains an error. The values are bit flags that may be interpreted by the protocol handler.
|
strong |
Enumeration of Ethernet message types used in the protocol.
Each message type corresponds to a specific operation or request within the Ethernet communication protocol.
|
strong |
Enum class representing the status codes for an Ethernet SQI reply.
This enum class defines the possible reply statuses returned in response to an SQI (Serial Quality Indicator) communication with a System on Chip (SoC).
Enumerator | |
---|---|
BSY | Device is busy and cannot process the request. |
ACK | Acknowledgment received. |
ERR | Error occurred during processing. |
EthernetMessage parseEthernetMessage | ( | const std::vector< uint8_t > & | buffer | ) |
Parses a raw Ethernet message buffer into a structured EthernetMessage.
This function interprets the first 7 bytes of the buffer as the message header, extracting the type, sequence ID, status, and payload size. If the size field is greater than zero, it also extracts the payload data.
buffer | The raw byte buffer containing the Ethernet message. Must be at least 7 bytes long to contain the header. |
std::runtime_error | If the buffer is smaller than the required header size. |
std::vector< uint8_t > serializeEthernetMessage | ( | const EthernetMessage & | message | ) |
Serializes an EthernetMessage object into a byte buffer.
This function converts the provided EthernetMessage into a byte array, which can be sent over a network. The EthernetMessage type, ID, status, size, and any associated data are serialized into the buffer in a specific format expected by the receiving device.
message | The EthernetMessage object to serialize. |