$search
A simple messaging protocol for communicating with industrial robot controllers. More...
#include <simple_message.h>
Public Member Functions | |
int | getCommType () |
industrial::byte_array::ByteArray & | getData () |
int | getDataLength () |
int | getMessageType () |
int | getMsgLength () |
int | getReplyCode () |
bool | init (industrial::byte_array::ByteArray &msg) |
bool | init (int msgType, int commType, int replyCode) |
bool | init (int msgType, int commType, int replyCode, industrial::byte_array::ByteArray &data) |
SimpleMessage () | |
void | toByteArray (industrial::byte_array::ByteArray &msg) |
bool | validateMessage () |
performs logical checks to ensure that the message is fully defined and adheres to the message conventions. | |
~SimpleMessage (void) | |
Static Public Member Functions | |
static unsigned int | getHeaderSize () |
static unsigned int | getLengthSize () |
Private Member Functions | |
void | setCommType (int commType) |
void | setData (industrial::byte_array::ByteArray &data) |
void | setMessageType (int msgType) |
void | setReplyCode (int replyCode) |
Private Attributes | |
industrial::shared_types::shared_int | comm_type_ |
industrial::byte_array::ByteArray | data_ |
industrial::shared_types::shared_int | message_type_ |
industrial::shared_types::shared_int | reply_code_ |
Static Private Attributes | |
static const unsigned int | HEADER_SIZE |
static const unsigned int | LENGTH_SIZE = sizeof(industrial::shared_types::shared_int) |
A simple messaging protocol for communicating with industrial robot controllers.
Definition at line 125 of file simple_message.h.
industrial::simple_message::SimpleMessage::SimpleMessage | ( | void | ) |
This class defines a simple messaging protocol for communicating with an industrial robot controller. The protocol meets the following requirements:
1. Format should be simple enough that code can be shared between ROS and the controller (for those controllers that support C/C++). For those controllers that do not support C/C++, the protocol must be simple enough to be decoded with the limited capabilities of the typical robot programming language. A corollary to this requirement is that the protocol should not be so onerous as to overwhelm the limited resources of the robot controller
2. Format should allow for data streaming (ROS topic like)
3. Format should allow for data reply (ROS service like)
4. The protocol is not intended to encapsulate version information It is up to individual developers to ensure that code developed for communicating platforms does not have any version conflicts (this includes message type identifiers).
Message Structure
<PREFIX> Not considered part of the message int LENGTH (HEADER + DATA) in bytes
<HEADER> int MSG_TYPE identifies type of message (standard and robot specific values) int COMM_TYPE identified communications type int REPLY CODE (service reply only) reply code <BODY> ByteArray DATA variable length data determined by message type and and communications type.
THIS CLASS IS NOT THREAD-SAFE
Definition at line 53 of file simple_message.cpp.
industrial::simple_message::SimpleMessage::~SimpleMessage | ( | void | ) |
Definition at line 57 of file simple_message.cpp.
int industrial::simple_message::SimpleMessage::getCommType | ( | ) | [inline] |
Definition at line 180 of file simple_message.h.
industrial::byte_array::ByteArray& industrial::simple_message::SimpleMessage::getData | ( | ) | [inline] |
Definition at line 184 of file simple_message.h.
int industrial::simple_message::SimpleMessage::getDataLength | ( | ) | [inline] |
Definition at line 183 of file simple_message.h.
static unsigned int industrial::simple_message::SimpleMessage::getHeaderSize | ( | ) | [inline, static] |
Definition at line 176 of file simple_message.h.
static unsigned int industrial::simple_message::SimpleMessage::getLengthSize | ( | ) | [inline, static] |
Definition at line 177 of file simple_message.h.
int industrial::simple_message::SimpleMessage::getMessageType | ( | ) | [inline] |
Definition at line 179 of file simple_message.h.
int industrial::simple_message::SimpleMessage::getMsgLength | ( | ) | [inline] |
Definition at line 182 of file simple_message.h.
int industrial::simple_message::SimpleMessage::getReplyCode | ( | ) | [inline] |
Definition at line 181 of file simple_message.h.
bool industrial::simple_message::SimpleMessage::init | ( | industrial::byte_array::ByteArray & | msg | ) |
Definition at line 82 of file simple_message.cpp.
bool industrial::simple_message::SimpleMessage::init | ( | int | msgType, | |
int | commType, | |||
int | replyCode | |||
) |
Definition at line 63 of file simple_message.cpp.
bool industrial::simple_message::SimpleMessage::init | ( | int | msgType, | |
int | commType, | |||
int | replyCode, | |||
industrial::byte_array::ByteArray & | data | |||
) |
Definition at line 70 of file simple_message.cpp.
void industrial::simple_message::SimpleMessage::setCommType | ( | int | commType | ) | [inline, private] |
Definition at line 209 of file simple_message.h.
void industrial::simple_message::SimpleMessage::setData | ( | industrial::byte_array::ByteArray & | data | ) | [private] |
Definition at line 128 of file simple_message.cpp.
void industrial::simple_message::SimpleMessage::setMessageType | ( | int | msgType | ) | [inline, private] |
Definition at line 208 of file simple_message.h.
void industrial::simple_message::SimpleMessage::setReplyCode | ( | int | replyCode | ) | [inline, private] |
Definition at line 210 of file simple_message.h.
void industrial::simple_message::SimpleMessage::toByteArray | ( | industrial::byte_array::ByteArray & | msg | ) |
Definition at line 113 of file simple_message.cpp.
bool industrial::simple_message::SimpleMessage::validateMessage | ( | ) |
performs logical checks to ensure that the message is fully defined and adheres to the message conventions.
Definition at line 134 of file simple_message.cpp.
industrial::shared_types::shared_int industrial::simple_message::SimpleMessage::comm_type_ [private] |
Definition at line 199 of file simple_message.h.
Definition at line 201 of file simple_message.h.
const unsigned int industrial::simple_message::SimpleMessage::HEADER_SIZE [static, private] |
sizeof(industrial::shared_types::shared_int) + sizeof(industrial::shared_types::shared_int) + sizeof(industrial::shared_types::shared_int)
Definition at line 203 of file simple_message.h.
const unsigned int industrial::simple_message::SimpleMessage::LENGTH_SIZE = sizeof(industrial::shared_types::shared_int) [static, private] |
Definition at line 206 of file simple_message.h.
industrial::shared_types::shared_int industrial::simple_message::SimpleMessage::message_type_ [private] |
Definition at line 198 of file simple_message.h.
industrial::shared_types::shared_int industrial::simple_message::SimpleMessage::reply_code_ [private] |
Definition at line 200 of file simple_message.h.