#include <ArSickPacketReceiver.h>
Public Member Functions | |
ArSickPacketReceiver (ArDeviceConnection *deviceConnection, unsigned char receivingAddress=0, bool allocatePackets=false, bool useBase0Address=false) | |
Constructor with assignment of a device connection. | |
ArSickPacketReceiver (unsigned char receivingAddress=0, bool allocatePackets=false, bool useBase0Address=false) | |
Constructor without an already assigned device connection. | |
ArDeviceConnection * | getDeviceConnection (void) |
Gets the device this instance receives packets from. | |
bool | isAllocatingPackets (void) |
Gets whether or not the receiver is allocating packets. | |
ArSickPacket * | receivePacket (unsigned int msWait=0) |
Receives a packet from the robot if there is one available. | |
void | setDeviceConnection (ArDeviceConnection *deviceConnection) |
Sets the device this instance receives packets from. | |
virtual | ~ArSickPacketReceiver () |
Destructor. | |
Protected Types | |
enum | { STATE_START, STATE_ADDR, STATE_START_COUNT, STATE_ACQUIRE_DATA } |
Protected Attributes | |
bool | myAllocatePackets |
ArDeviceConnection * | myDeviceConn |
ArSickPacket | myPacket |
unsigned char | myReceivingAddress |
bool | myUseBase0Address |
Definition at line 35 of file ArSickPacketReceiver.h.
|
Constructor without an already assigned device connection.
Definition at line 40 of file ArSickPacketReceiver.cpp. |
|
Constructor with assignment of a device connection.
Definition at line 57 of file ArSickPacketReceiver.cpp. |
|
Receives a packet from the robot if there is one available.
Definition at line 93 of file ArSickPacketReceiver.cpp. References ArTime::addMSec(), ArBasePacket::dataToBuf(), ArSickPacket::duplicatePacket(), ArBasePacket::empty(), ArBasePacket::getHeaderLength(), ArBasePacket::getMaxLength(), ArDeviceConnection::getStatus(), ArDeviceConnection::getTimeRead(), ArLog::log(), ArTime::mSecTo(), ArDeviceConnection::read(), ArSickPacket::resetRead(), ArBasePacket::setLength(), ArSickPacket::setTimeReceived(), ArTime::setToNow(), ArBasePacket::uByteToBuf(), and ArSickPacket::verifyCRC(). Referenced by ArSick::disconnect(), ArSick::internalConnectHandler(), and ArSick::runOnce(). |