Main Page   Class Hierarchy   Compound List   Compound Members  

ArRobotPacketReceiver Class Reference

Given a device connection it receives packets from the robot through it. More...

#include <ArRobotPacketReceiver.h>

List of all members.

Public Methods

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

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

virtual ~ArRobotPacketReceiver (void)
 Destructor.

ArRobotPacketreceivePacket (unsigned int msWait=0)
 Receives a packet from the robot if there is one available. More...

void setDeviceConnection (ArDeviceConnection *deviceConnection)
 Sets the device this instance receives packets from.

ArDeviceConnectiongetDeviceConnection (void)
 Gets the device this instance receives packets from.

bool isAllocatingPackets (void)
 Gets whether or not the receiver is allocating packets.


Detailed Description

Given a device connection it receives packets from the robot through it.


Constructor & Destructor Documentation

ArRobotPacketReceiver::ArRobotPacketReceiver bool    allocatePackets = false,
unsigned char    sync1 = 0xfa,
unsigned char    sync2 = 0xfb
 

Constructor without an already assigned device connection.

Parameters:
allocatePackets  whether to allocate memory for the packets before returning them (true) or to just return a pointer to an internal packet (false)... most everything should use false as this will help prevent many memory leaks or corruptions
sync1  first byte of the header this receiver will receive, this should be left as the default in nearly all cases, ie don't mess with it
sync2  second byte of the header this receiver will receive, this should be left as the default in nearly all cases, ie don't mess with it

ArRobotPacketReceiver::ArRobotPacketReceiver ArDeviceConnection   deviceConnection,
bool    allocatePackets = false,
unsigned char    sync1 = 0xfa,
unsigned char    sync2 = 0xfb
 

Constructor with assignment of a device connection.

Parameters:
deviceConnection  the connection which the receiver will use
allocatePackets  whether to allocate memory for the packets before returning them (true) or to just return a pointer to an internal packet (false)... most everything should use false as this will help prevent many memory leaks or corruptions
sync1  first byte of the header this receiver will receive, this should be left as the default in nearly all cases, ie don't mess with it
sync2  second byte of the header this receiver will receive, this should be left as the default in nearly all cases, ie don't mess with it


Member Function Documentation

ArRobotPacket * ArRobotPacketReceiver::receivePacket unsigned int    msWait = 0
 

Receives a packet from the robot if there is one available.

Parameters:
msWait  how long to block for the start of a packet, nonblocking if 0
Returns:
NULL if there are no packets in alloted time, otherwise a pointer to the packet received, if allocatePackets is true than the place that called this function owns the packet and should delete the packet when done... if allocatePackets is false then nothing must store a pointer to this packet, the packet must be used and done with by the time this method is called again


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