#include <ArNetPacketReceiverTcp.h>
Public Member Functions | |
ArNetPacketReceiverTcp () | |
Constructor. | |
ArFunctor1< ArNetPacket * > * | getProcessPacketCB (void) |
Gets the callback used when a packet is received. | |
bool | getQuiet (void) |
Gets whether we're quiet about errors or not. | |
ArSocket * | getSocket (void) |
Gets the socket this receiver uses. | |
bool | readData (void) |
Reads in all the data available calling the processPacketCB. | |
void | setLoggingPrefix (const char *loggingPrefix) |
Sets the logging prefix. | |
void | setProcessPacketCB (ArFunctor1< ArNetPacket * > *functor) |
Sets the callback for use when a packet is received. | |
void | setQuiet (bool quiet) |
Sets whether we're quiet about errors or not. | |
void | setSocket (ArSocket *socket) |
Sets the socket this receiver uses. | |
~ArNetPacketReceiverTcp () | |
Destructor. | |
Protected Types | |
enum | { TOTAL_PACKET_LENGTH = ArNetPacket::MAX_LENGTH+ArNetPacket::HEADER_LENGTH+ArNetPacket::FOOTER_LENGTH } |
enum | Ret { RET_CONN_CLOSED, RET_GOT_PACKET, RET_BAD_PACKET, RET_FAILED_READ, RET_TIMED_OUT } |
enum | State { STATE_SYNC1, STATE_SYNC2, STATE_LENGTH1, STATE_LENGTH2, STATE_ACQUIRE_DATA } |
Protected Member Functions | |
Ret | readPacket (int msWait) |
Reads in a single packet, returns NULL if not one. | |
Protected Attributes | |
ArTime | myLastPacket |
std::string | myLoggingPrefix |
ArNetPacket | myPacket |
ArFunctor1< ArNetPacket * > * | myProcessPacketCB |
bool | myQuiet |
char | myReadBuff [TOTAL_PACKET_LENGTH] |
int | myReadCommand |
int | myReadCount |
int | myReadLength |
ArSocket * | mySocket |
State | myState |
unsigned char | mySync1 |
unsigned char | mySync2 |