10 #ifndef GBXSERIALDEVICEACFR_SERIALDEVICEHANDLER_H 11 #define GBXSERIALDEVICEACFR_SERIALDEVICEHANDLER_H 13 #include <gbxserialacfr/serial.h> 14 #include <gbxutilacfr/substatus.h> 15 #include <gbxsickacfr/gbxiceutilacfr/safethread.h> 16 #include <gbxsickacfr/gbxiceutilacfr/store.h> 17 #include <IceUtil/IceUtil.h> 22 class RxMsg :
public IceUtil::Shared
29 virtual bool isWarn()
const {
return false; }
32 virtual bool isError()
const {
return false; }
35 virtual std::string toString()
const=0;
37 typedef IceUtil::Handle<RxMsg> RxMsgPtr;
54 virtual RxMsgPtr parseBuffer(
const std::vector<char> &buffer,
55 int &numBytesParsed ) = 0;
70 virtual void msgReceived(
const RxMsgPtr &msg,
72 int timeStampUsec )=0;
103 bool verboseDebug=
false,
104 int unparsedBytesWarnThreshold = 20000 );
106 { rxMsgCallback_ = &callback; }
111 void send(
const char* commandBytes,
int numCommandBytes );
114 void setBaudRate(
int baudRate );
117 void startAndWaitTillIsRunning();
128 bool getDataFromSerial();
130 bool processBuffer();
140 std::vector<char> buffer_;
144 int unparsedBytesWarnThreshold_;
149 const bool verboseDebug_;
152 typedef IceUtil::Handle<SerialDeviceHandler> SerialDeviceHandlerPtr;
Definition: serialdevicehandler.h:43
Definition: serialdevicehandler.h:66
Encapsulates a serial port.
Definition: serial.h:43
A version of the Thread class which catches all possible exceptions.
Definition: safethread.h:43
Local and remote tracing.
Definition: tracer.h:111
A base-class for a message received from the device on the other end.
Definition: serialdevicehandler.h:22
Convenience class which maniupulates the status of a subsystem.
Definition: substatus.h:39
Definition: printutil.cpp:8
Handles the serial port.
Definition: serialdevicehandler.h:88
Local interface to component status.
Definition: status.h:253