123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- #ifndef _DEVICEGASV4_HPP_
- #define _DEVICEGASV4_HPP_
- #include "UtilBase.hpp"
- #include "Util/logger.h"
- #include "requests.hpp"
- namespace gsd
- {
- class DevicePlayerV4: public ContorlTcplBase
- {
- private:
- enum RECV_STEP{
- STEP_HEAD_1 = 0,
- STEP_HEAD_2 = 1,
- STEP_TYPE = 2,
- STEP_DEVID = 3,
- STEP_COM = 4,
- STEP_ACK = 5
- };
- typedef struct {
- uint8_t dataCount;
- uint8_t dataLength;
- uint8_t dataCheckSum;
- uint8_t data[6];
- enum RECV_STEP step = STEP_HEAD_1;
- }ExpelComm;
- ExpelComm _comm;
- public:
- DevicePlayerV4(): ContorlTcplBase(){
- this->DeviceInfo = "赛为智能驱鸟器协议";
- this->tool = DeviceTools::tcp;
- }
- ~DevicePlayerV4(){}
-
- float voltage = 0;
-
- float pressure = 0;
-
- int state = 0;
-
- float latitude = 0;
-
- float longitude = 0;
- static unsigned char check(unsigned char *pSendBuf,unsigned char num);
- static void serialization(const ControlerMsg gasControl,char *data);
- bool deserialization()
- {
- return true;
- }
- bool Consumer(uint8_t *data, int len, int &msg_id);
- bool deserialization(const uint8_t *data, int len, int &msg_id);
-
-
- int8_t Open(std::string DeviceId, uint8_t* data, int& length);
-
-
- int8_t Close(std::string DeviceId, uint8_t* data, int& length);
-
-
- int8_t Fire(std::string DeviceId, uint8_t* data, int& length);
-
-
- int8_t Status(std::string DeviceId, uint8_t* data, int& length);
-
-
- bool getStatusMsg(int &msg_id){
- return true;
- }
-
-
-
- void BuildDeviceInfo(SendDevice& sendDevice);
- };
-
- }
- #endif
|