Motion Master
|
Classes | |
class | Device |
Handles TCP communication with SOMANET devices over SPoE. More... | |
class | DeviceParameterRefresher |
Concrete refresher that uploads parameters from a device. More... | |
struct | Message |
struct | ServerInfo |
Contains information about the server's protocol version and monitoring mode. More... | |
Enumerations | |
enum class | SpoeMessageType : uint8_t { SDO_READ = 0x01 , SDO_WRITE = 0x02 , PDO_RXTX_FRAME , PDO_CONTROL = 0x04 , SDO_BATCH_READ = 0x06 , FIRMWARE_UPDATE = 0x0B , FILE_READ = 0x0C , FILE_WRITE = 0x0D , STATE_CONTROL , STATE_READ = 0x0F , PARAM_LIST = 0x13 , SERVER_INFO = 0x20 } |
Enumeration of SPoE message types used in the protocol. More... | |
enum class | SpoeMessageRequestStatus : uint8_t { OK = 0x00 , FIRST = 0x80 , MIDDLE = 0xC0 , LAST = 0x40 } |
Status codes representing the state of an SPoE request message. More... | |
enum class | SpoeMessageParamListErrorStatus : uint8_t { SUCCESS_ACK = 0x58 , ERR = 0x63 , BUSY_INDICATION = 0x28 } |
Error status codes returned when reading the parameter list via SPoE. More... | |
enum class | SpoeMessageSdoStatus : uint16_t { NO_ERR = 0x0000 , GENERIC = 0x0001 , NOT_FOUND = 0x0002 , READ_ONLY = 0x0003 , WRITE_ONLY = 0x0004 , WRONG_TYPE = 0x0005 , INVALID_LIST = 0x0006 , INSUFFICIENT_BUFFER = 0x0007 , VALUEINFO_UNAVAILABLE = 0x0008 , UNKNOWN_OR_UNSUPPORTED = 0x0009 , LOCAL_TRANSFER = 0x000A , UNSUPPORTED_ACCESS = 0x000B , SI0_NOT_ZERO = 0x000C , SUB_NOT_FOUND = 0x000D } |
Status codes returned during SDO (Service Data Object) read and write operations. More... | |
enum class | SpoeMessageFileErrorStatus : uint8_t { SUCCESS_ACK = 0x58 , UNDEFINED = 0x00 , NOT_FOUND = 0x01 , ACCESS_DENIED = 0x02 , STORAGE_FULL = 0x03 , ILLEGAL_REQ = 0x04 , PACKET_NUMBER = 0x05 , ALREADY_EXISTS = 0x06 , NO_USER = 0x07 , BOOTSTRAP_ONLY = 0x08 , NOT_BOOTSTRAP = 0x09 , NO_RIGHTS = 0x0A , PROGRAM_ERROR = 0x0B , BUSY = 0x0C , FILENAME_LEN = 0x0D , TIMEOUT = 0x0E , FLASH_BUSY = 0x28 , COMMUNICATION_BRIDGE_ERROR = 0x63 } |
Error status codes returned when reading or writing a file via SPoE message. More... | |
enum class | SpoeMessagePacketStatus : uint8_t { OK = 0x00 , FIRST = 0x80 , MIDDLE = 0xC0 , LAST = 0x40 } |
Packet status codes for SPoE messages. More... | |
enum class | PdoMode : uint8_t { NONE = 0 , MONITOR , CONTROL = 2 } |
Defines the modes for Process Data Object (PDO) communication over SPoE. More... | |
Functions | |
Message | parseMessage (const std::vector< uint8_t > &buffer) |
Parses a raw SPoE message buffer into a structured SpoeMessage. More... | |
std::vector< uint8_t > | serializeSpoeMessage (const Message &message) |
Serializes an SpoeMessage object into a byte buffer. More... | |
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE (Message, type, id, status, size, data) | |
|
strong |
Defines the modes for Process Data Object (PDO) communication over SPoE.
Enumerator | |
---|---|
NONE | No process or cyclic data exchange available. |
MONITOR | Device sends RxPDO values only; incoming requests are ignored. |
CONTROL | Both RxPDO and TxPDO data exchange enabled. |
|
strong |
Error status codes returned when reading or writing a file via SPoE message.
|
strong |
Packet status codes for SPoE messages.
This enum defines various status flags used to indicate the completeness and validity of a SPoE message, including support for segmented transfers.
Enumerator | |
---|---|
OK | Message is complete and valid. |
FIRST | First segment of a multi-part message. |
MIDDLE | Middle segment of a multi-part message. |
LAST | Last segment of a multi-part message. |
|
strong |
|
strong |
Status codes representing the state of an SPoE request message.
This enum indicates whether a message is complete, part of a segmented sequence, or contains an error.
Enumerator | |
---|---|
OK | Message is complete and valid. |
FIRST | First segment of a multi-part message. |
MIDDLE | Middle segment of a multi-part message. |
LAST | Last segment of a multi-part message. |
|
strong |
Status codes returned during SDO (Service Data Object) read and write operations.
These codes represent the result of accessing parameters on the SPoE device.
|
strong |
Enumeration of SPoE message types used in the protocol.
Each message type corresponds to a specific operation or request within the SPoE communication protocol.
Message mm::comm::spoe::parseMessage | ( | const std::vector< uint8_t > & | buffer | ) |
Parses a raw SPoE message buffer into a structured SpoeMessage.
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 SPoE 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 > mm::comm::spoe::serializeSpoeMessage | ( | const Message & | message | ) |
Serializes an SpoeMessage object into a byte buffer.
This function converts the provided SpoeMessage into a byte array, which can be sent over a network. The SpoeMessage type, ID, status, size, and any associated data are serialized into the buffer in a specific format expected by the receiving device.
message | The SpoeMessage object to serialize. |