00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef ARSICKPACKETRECEIVER_H
00028 #define ARSICKPACKETRECEIVER_H
00029
00030 #include "ariaTypedefs.h"
00031 #include "ArDeviceConnection.h"
00032 #include "ArSickPacket.h"
00033
00035 class ArSickPacketReceiver
00036 {
00037 public:
00039 ArSickPacketReceiver(unsigned char receivingAddress = 0,
00040 bool allocatePackets = false,
00041 bool useBase0Address = false);
00043 ArSickPacketReceiver(ArDeviceConnection *deviceConnection,
00044 unsigned char receivingAddress = 0,
00045 bool allocatePackets = false,
00046 bool useBase0Address = false);
00048 virtual ~ArSickPacketReceiver();
00049
00051 ArSickPacket *receivePacket(unsigned int msWait = 0);
00052
00054 void setDeviceConnection(ArDeviceConnection *deviceConnection);
00056 ArDeviceConnection *getDeviceConnection(void);
00057
00059 bool isAllocatingPackets(void) { return myAllocatePackets; }
00060
00061 protected:
00062 ArDeviceConnection *myDeviceConn;
00063 bool myAllocatePackets;
00064 ArSickPacket myPacket;
00065 unsigned char myReceivingAddress;
00066 bool myUseBase0Address;
00067 enum { STATE_START, STATE_ADDR, STATE_START_COUNT, STATE_ACQUIRE_DATA };
00068 };
00069
00070 #endif // ARSICKPACKETRECEIVER_H