Main Page   Class Hierarchy   Compound List   Compound Members  

ArSickPacket Class Reference

Represents the packets sent to the sick as well as those received from it. More...

#include <ArSickPacket.h>

Inheritance diagram for ArSickPacket::

ArBasePacket List of all members.

Public Methods

 ArSickPacket (unsigned char sendingAddress=0)
 Constructor.

virtual ~ArSickPacket (void)
 Destructor.

void setSendingAddress (unsigned char address)
 Sets the address to send this packet to (only use for sending). More...

unsigned char getSendingAddress (void)
 Sets the address to send this packet to (only use for sending). More...

unsigned char getReceivedAddress (void)
 Gets the address this packet was sent from (only use for receiving). More...

bool verifyCRC (void)
 returns true if the crc matches what it should be.

ArTypes::UByte getID (void)
 returns the ID of the packet (first byte of data).

ArTypes::Byte2 calcCRC (void)
 returns the crc, probably used only internally.

virtual void finalize (void)
 Finalizes the packet in preparation for sending, must be done.

virtual void resetRead (void)
 Restart the reading process. More...

ArTime getTimeReceived (void)
 Gets the time the packet was received at.

void setTimeReceived (ArTime timeReceived)
 Sets the time the packet was received at.

virtual void duplicatePacket (ArSickPacket *packet)
 Duplicates the packet. More...


Detailed Description

Represents the packets sent to the sick as well as those received from it.

This class reimplements some of the buf operations since the robot is little endian.

You can just look at the documentation for the ArBasePacket except for these functions here, setAddress, getAddress, verifyCheckSum, print, getID, and calcCheckSum.


Member Function Documentation

void ArSickPacket::duplicatePacket ArSickPacket *    packet [virtual]
 

Duplicates the packet.

Copies the given packets buffer into the buffer of this packet, also sets this length and readlength to what the given packet has

Parameters:
packet  the packet to duplicate

unsigned char ArSickPacket::getReceivedAddress void   
 

Gets the address this packet was sent from (only use for receiving).

This gets the address that this packet was received from. Note that this is only valid if this packet was received from a laser, if you want to know where a packet was addressed to use getSendingAdress instead.

Returns:
the address a packet was received from

unsigned char ArSickPacket::getSendingAddress void   
 

Sets the address to send this packet to (only use for sending).

This gets the address for use in sending packets, the address is what has been saved, then when a packet is finalized for sending, the address is put into the appropriate spot in the packet.

Returns:
the address of the laser to be addressed

void ArSickPacket::resetRead void    [virtual]
 

Restart the reading process.

Sets the length read back to the header length so the packet can be reread using the other methods

Reimplemented from ArBasePacket.

void ArSickPacket::setSendingAddress unsigned char    address
 

Sets the address to send this packet to (only use for sending).

This sets the address for use in sending packets, the address is saved, then when a packet is finalized for sending, the address is put into the appropriate spot in the packet.

Parameters:
address  the address of the laser to be addressed


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