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.

104 lines
2.0 KiB

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