#include <ArLMS2xxPacketReceiver.h>
Public Member Functions | |
| ArLMS2xxPacketReceiver (ArDeviceConnection *deviceConnection, unsigned char receivingAddress=0, bool allocatePackets=false, bool useBase0Address=false) | |
| Constructor with assignment of a device connection. | |
| ArLMS2xxPacketReceiver (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. | |
| ArLMS2xxPacket * | 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 | ~ArLMS2xxPacketReceiver () |
| Destructor. | |
Protected Types | |
| enum | { STATE_START, STATE_ADDR, STATE_START_COUNT, STATE_ACQUIRE_DATA } |
| STATE_ACQUIRE_DATA | |
| STATE_ADDR | |
| STATE_START | |
| STATE_START_COUNT | |
Protected Attributes | |
| bool | myAllocatePackets |
| ArDeviceConnection * | myDeviceConn |
| ArLMS2xxPacket | myPacket |
| unsigned char | myReceivingAddress |
| bool | myUseBase0Address |
| ArLMS2xxPacketReceiver::ArLMS2xxPacketReceiver | ( | unsigned char | receivingAddress = 0, |
|
| bool | allocatePackets = false, |
|||
| bool | useBase0Address = false | |||
| ) |
Constructor without an already assigned device connection.
| 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 |
| ArLMS2xxPacketReceiver::ArLMS2xxPacketReceiver | ( | ArDeviceConnection * | deviceConnection, | |
| unsigned char | receivingAddress = 0, |
|||
| bool | allocatePackets = false, |
|||
| bool | useBase0Address = false | |||
| ) |
Constructor with assignment of a device connection.
| 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 |
| ArLMS2xxPacket * ArLMS2xxPacketReceiver::receivePacket | ( | unsigned int | msWait = 0 |
) |
Receives a packet from the robot if there is one available.
| msWait | how long to block for the start of a packet, nonblocking if 0 |
1.4.7