52 namespace smpl_msg_connection
66 sendBuffer.
load(msgData);
67 rtn = this->sendBytes(sendBuffer);
72 LOG_ERROR(
"Message validation failed, message not sent");
88 rtn = this->receiveBytes(lengthBuffer, message.
getLengthSize());
92 rtn = lengthBuffer.
unload(length);
93 LOG_COMM(
"Message length: %d", length);
97 rtn = this->receiveBytes(msgBuffer, length);
101 rtn = message.
init(msgBuffer);
105 LOG_ERROR(
"Failed to initialize message");
118 LOG_ERROR(
"Failed to receive message length");
130 rtn = this->sendMsg(send);
136 rtn = this->receiveMsg(recv);
void toByteArray(industrial::byte_array::ByteArray &msg)
Populates a raw byte array with the message. Any data stored in the passed in byte array is deleted...
bool validateMessage()
performs logical checks to ensure that the message is fully defined and adheres to the message conven...
This class defines a simple messaging protocol for communicating with an industrial robot controller...
#define LOG_COMM(format,...)
bool load(industrial::shared_types::shared_bool value)
loads a boolean into the byte array
#define LOG_ERROR(format,...)
The byte array wraps a dynamic array of bytes (i.e. char).
bool init(int msgType, int commType, int replyCode, industrial::byte_array::ByteArray &data)
Initializes a fully populated simple message.
static unsigned int getLengthSize()
Gets size of message length member in bytes (fixed)
unsigned int getBufferSize()
gets current buffer size
bool unload(industrial::shared_types::shared_bool &value)
unloads a boolean value from the byte array