#include <ArRobotPacketSender.h>
Definition at line 36 of file ArRobotPacketSender.h.
Public Member Functions | |
ArRobotPacketSender (ArDeviceConnection *deviceConnection, unsigned char sync1=0xfa, unsigned char sync2=0xfb) | |
Constructor with assignment of a device connection. | |
ArRobotPacketSender (unsigned char sync1=0xfa, unsigned char sync2=0xfb) | |
Constructor without an already assigned device connection. | |
bool | com (unsigned char command) |
Sends a command to the robot with no arguments. | |
bool | com2Bytes (unsigned char command, char high, char low) |
Sends a command to the robot with two bytes for argument. | |
bool | comDataN (unsigned char command, const char *data, int size) |
Sends a command containing exactly the data in the given buffer as argument. | |
bool | comInt (unsigned char command, short int argument) |
Sends a command to the robot with an int for argument. | |
bool | comStr (unsigned char command, const char *argument) |
Sends a command to the robot with a length-prefixed string for argument. | |
bool | comStrN (unsigned char command, const char *str, int size) |
Sends a command to the robot with a length-prefixed string for argument. | |
ArDeviceConnection * | getDeviceConnection (void) |
Gets the device this instance sends commands to. | |
void | setDeviceConnection (ArDeviceConnection *deviceConnection) |
Sets the device this instance sends commands to. | |
virtual | ~ArRobotPacketSender () |
Destructor. | |
Protected Types | |
enum | { INTARG = 0x3B, NINTARG = 0x1B, STRARG = 0x2B } |
Protected Member Functions | |
bool | connValid (void) |
Protected Attributes | |
ArDeviceConnection * | myDeviceConn |
ArRobotPacket | myPacket |
|
Constructor without an already assigned device connection.
Definition at line 37 of file ArRobotPacketSender.cpp. |
|
Constructor with assignment of a device connection.
Definition at line 50 of file ArRobotPacketSender.cpp. |
|
Sends a command to the robot with no arguments.
Definition at line 84 of file ArRobotPacketSender.cpp. |
|
Sends a command to the robot with two bytes for argument.
Definition at line 137 of file ArRobotPacketSender.cpp. |
|
Sends a command to the robot with an int for argument.
Definition at line 102 of file ArRobotPacketSender.cpp. |
|
Sends a command to the robot with a length-prefixed string for argument. Sends a length-prefixed string command.
Definition at line 149 of file ArRobotPacketSender.cpp. |
|
Sends a command to the robot with a length-prefixed string for argument. Sends a packet containing the given command, and a length-prefixed string containing the specified number of bytes copied from the given source string.
Definition at line 183 of file ArRobotPacketSender.cpp. |