![]() |
IRSOL
C++ code implementing socket server for interacting with Baumer camera.
|
Welcome to the irsol::protocol
subsystem! This guide provides an overview and practical introduction to the core capabilities and design of the protocol communication layer used in the irsol framework.
irsol::protocol
?The irsol::protocol
namespace defines the structured communication protocol used for message exchange between clients and servers within irsol. It offers:
The protocol is designed for clarity, safety, and extensibility, making it easy to integrate new message types and evolve the protocol without breaking existing clients or servers.
Messages in the protocol fall into two main categories based on who sends them:
Instead of handling raw strings or loosely structured data, messages are represented as C++ variant types containing strongly-typed classes. This approach ensures:
irsol::protocol
provides utilities to:
SOH
, STX
, ETX
bytes).int
, double
, string
) with proper formatting Each message type is represented by a dedicated class with:
For example:
Assignment
messages contain an identifier and a value to set.Success
messages confirm the completion of an operation.BinaryDataBuffer
messages encapsulate raw data payloads.Although not covered in detail here, the protocol provides a irsol::protocol::Parser to:
Serializer
The irsol::protocol::Serializer class provides static methods to:
Serialization consumes the message object, ensuring efficient handling of large or binary payloads.
Errors in the protocol are communicated via irsol::protocol::Error messages containing:
This mechanism ensures that clients receive clear feedback on invalid requests or unexpected conditions.