Main Page   Class Hierarchy   Compound List   Compound Members  

ArRobotPacketSender Class Reference

Given a device connection this sends commands through it to the robot. More...

#include <ArRobotPacketSender.h>

List of all members.

Public Methods

 ArRobotPacketSender (unsigned char sync1=0xfa, unsigned char sync2=0xfb)
 Constructor without an already assigned device connection. More...

 ArRobotPacketSender (ArDeviceConnection *deviceConnection, unsigned char sync1=0xfa, unsigned char sync2=0xfb)
 Constructor with assignment of a device connection. More...

virtual ~ArRobotPacketSender (void)
 Destructor.

bool com (unsigned char command)
 Sends a command to the robot with no arguments. More...

bool comInt (unsigned char command, short int argument)
 Sends a command to the robot with an int for argument. More...

bool com2Bytes (unsigned char command, char high, char low)
 Sends a command to the robot with two bytes for argument. More...

bool comStr (unsigned char command, const char *argument)
 Sends a command to the robot with a string for argument. More...

bool comStrN (unsigned char command, const char *str, int size)
 Sends a command to the robot with a size bytes of str as argument. More...

void setDeviceConnection (ArDeviceConnection *deviceConnection)
 Sets the device this instance sends commands to.

ArDeviceConnectiongetDeviceConnection (void)
 Gets the device this instance sends commands to.


Detailed Description

Given a device connection this sends commands through it to the robot.


Constructor & Destructor Documentation

ArRobotPacketSender::ArRobotPacketSender unsigned char    sync1 = 0xfa,
unsigned char    sync2 = 0xfb
 

Constructor without an already assigned device connection.

Parameters:
sync1  first byte of the header this sender will send, this should be left as the default in nearly all cases, ie don't mess with it
sync2  second byte of the header this sender will send, this should be left as the default in nearly all cases, ie don't mess with it

ArRobotPacketSender::ArRobotPacketSender ArDeviceConnection   deviceConnection,
unsigned char    sync1 = 0xfa,
unsigned char    sync2 = 0xfb
 

Constructor with assignment of a device connection.

Parameters:
sync1  first byte of the header this sender will send, this should be left as the default in nearly all cases, ie don't mess with it
sync2  second byte of the header this sender will send, this should be left as the default in nearly all cases, ie don't mess with it


Member Function Documentation

bool ArRobotPacketSender::com unsigned char    number
 

Sends a command to the robot with no arguments.

Parameters:
command  the command number to send
Returns:
whether the command could be sent or not

bool ArRobotPacketSender::com2Bytes unsigned char    command,
char    high,
char    low
 

Sends a command to the robot with two bytes for argument.

Parameters:
command  the command number to send
high  the high byte to send with the command
low  the low byte to send with the command
Returns:
whether the command could be sent or not

bool ArRobotPacketSender::comInt unsigned char    command,
short int    argument
 

Sends a command to the robot with an int for argument.

Parameters:
command  the command number to send
argument  the integer argument to send with the command
Returns:
whether the command could be sent or not

bool ArRobotPacketSender::comStr unsigned char    command,
const char *    argument
 

Sends a command to the robot with a string for argument.

Parameters:
command  the command number to send
str  the string to send with the command
Returns:
whether the command could be sent or not

bool ArRobotPacketSender::comStrN unsigned char    command,
const char *    str,
int    size
 

Sends a command to the robot with a size bytes of str as argument.

Parameters:
command  the command number to send
str  the character array to send with the command
size  length of the array to send
Returns:
whether the command could be sent or not


The documentation for this class was generated from the following files:
Generated on Tue Nov 12 17:44:04 2002 for Aria by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001