You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __PROTOCOL_LGS_HEADERS__
  2. #define __PROTOCOL_LGS_HEADERS__
  3. #include "../../components/base/basicFunctionality.h"
  4. #include "../../components/base/basicTransport.h"
  5. #include "../../components/base/basicMutex.h"
  6. #include "../../components/base/basicEventHeap.h"
  7. #include "../../hardware/soc/general/3DLRF.h"
  8. #include "../../alg/lgs/mask.h"
  9. #include "protocol.h"
  10. #include "protocolLGS_data.h"
  11. #ifdef _CLIENT_APPLICATION_
  12. #define SEND_TAG MASTER_TAG
  13. #define ACCEPT_TAG SENSOR_TAG
  14. #else
  15. #define SEND_TAG SENSOR_TAG
  16. #define ACCEPT_TAG MASTER_TAG
  17. #endif
  18. //Multibyte
  19. class protocolLGSM: public protocolParser{
  20. private:
  21. basicLogCollection *m_pLog;
  22. basicMutex m_mInquiryMutex;
  23. protected:
  24. uint8_t m_bDeviceID;
  25. int packetChecker( uint8_t *Buffer, size_t BufferSize);
  26. protocolPackage *packetExtractor( uint8_t *Buffer, size_t BufferSize);
  27. public:
  28. explicit protocolLGSM( basicTransport *Transport = NULL, uint8_t DeviceID = 0 );
  29. virtual ~protocolLGSM();
  30. virtual bool create(void){ return protocolParser::create(); };
  31. uint8_t getDeviceID(void) { return m_bDeviceID; };
  32. basicTransport * getTransport(void) { return m_oDataTransport; };
  33. bool setDeviceID( uint8_t DeviceID ){ m_bDeviceID = DeviceID; return true; };
  34. };
  35. // Single Byte
  36. class protocolLGSS: public protocolParser{
  37. private:
  38. basicLogCollection *m_pLog;
  39. basicMutex m_mInquiryMutex;
  40. protected:
  41. uint8_t m_bDeviceID;
  42. int packetChecker( uint8_t *Buffer, size_t BufferSize);
  43. protocolPackage *packetExtractor( uint8_t *Buffer, size_t BufferSize);
  44. public:
  45. explicit protocolLGSS( basicTransport *Transport = NULL, uint8_t DeviceID = 0 );
  46. virtual ~protocolLGSS();
  47. virtual bool create(void){ return protocolParser::create(); };
  48. uint8_t getDeviceID(void) { return m_bDeviceID; };
  49. basicTransport * getTransport(void) { return m_oDataTransport; };
  50. bool setDeviceID( uint8_t DeviceID ){ m_bDeviceID = DeviceID; return true; };
  51. };
  52. #endif