Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
industrial::simple_message::SimpleMessage Class Reference

A simple messaging protocol for communicating with industrial robot controllers. More...

#include <simple_message.h>

List of all members.

Public Member Functions

int getCommType ()
industrial::byte_array::ByteArraygetData ()
int getDataLength ()
int getMessageType ()
int getMsgLength ()
int getReplyCode ()
bool init (int msgType, int commType, int replyCode, industrial::byte_array::ByteArray &data)
bool init (int msgType, int commType, int replyCode)
bool init (industrial::byte_array::ByteArray &msg)
 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)

Detailed Description

A simple messaging protocol for communicating with industrial robot controllers.

Definition at line 125 of file simple_message.h.


Constructor & Destructor Documentation

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.

Definition at line 57 of file simple_message.cpp.


Member Function Documentation

Definition at line 180 of file simple_message.h.

Definition at line 184 of file simple_message.h.

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.

Definition at line 179 of file simple_message.h.

Definition at line 182 of file simple_message.h.

Definition at line 181 of file simple_message.h.

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.

bool industrial::simple_message::SimpleMessage::init ( int  msgType,
int  commType,
int  replyCode 
)

Definition at line 63 of file simple_message.cpp.

Definition at line 82 of file simple_message.cpp.

void industrial::simple_message::SimpleMessage::setCommType ( int  commType) [inline, private]

Definition at line 209 of file simple_message.h.

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.

Definition at line 113 of file simple_message.cpp.

performs logical checks to ensure that the message is fully defined and adheres to the message conventions.

Returns:
true if message valid, false otherwise

Definition at line 134 of file simple_message.cpp.


Member Data Documentation

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]
Initial value:
 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.


The documentation for this class was generated from the following files:


simple_message
Author(s): Shaun Edwards
autogenerated on Fri Jan 3 2014 11:26:56