runCtrlHub.h

Go to the documentation of this file.
00001 #ifndef RUN_CTRL_HUB_H
00002 #define RUN_CTRL_HUB_H
00003 
00013 #include "connectionHub.h"
00014 
00015 
00019 class RunCtrlHub : public ConnectionHub {
00020   enum {
00021     WaitCommandHeader, WaitCommandPacket,
00022     WaitReplyHeader, WaitReplyPacket,
00023     PacketSize = 512,
00024     RetryMax = 3,
00025     DefaultTimeout = 100,
00026   };
00027   int mode;
00028   int require_size;
00029   int cmd_filled;
00030   int reply_filled;
00031   int retry_max;
00032   int retry_times;
00033   int recv_timeout;
00034   char command_recv[PacketSize];
00035   char reply_recv[PacketSize];
00036   unsigned long wait_begin;
00037   void sendRetryPacket(void);
00038   void disconnect(void);
00039   RunCtrlHub(void);
00040 
00041 public:
00051   RunCtrlHub(int port, const char* device, long baudrate = 115200);
00052   ~RunCtrlHub(void);
00053 
00060   bool update(void);
00061 };
00062 
00063 #endif /* !RUN_CTRL_HUB_H */
00064 

Generated on Mon Apr 13 22:52:04 2009 by  doxygen 1.5.7.1