1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #pragma once
- #include "UtilBase.hpp"
- namespace gsd
- {
- class DeviceGasV2: public ContorlHttplBase
- {
- public:
- DeviceGasV2():ContorlHttplBase(){
- this->DeviceInfo = "合肥新桥机场 西安为开煤气炮驱动板协议";
- this->tool = DeviceTools::http;
- }
- // 电压
- float voltage = 0;
- // 状态
- int state = 0;
- // 纬度
- float latitude = 0;
- // 经度
- float longitude = 0;
- std::string fuwuid = "551";
- std::string key = "cc23a0046c2ba907f6cc779e67c7183b";
- /**
- * @description: 判定msg是否为status
- * @param {int} &msg_id
- * @return {*}
- */
- bool getStatusMsg(int &msg_id);
-
- /**
- * @description: 消费数据
- * @param {uint8_t} *data
- * @param {int} len
- * @param {int} &msg_id
- * @return {*}
- */
- bool Consumer(uint8_t *data, int len, int &msg_id);
- /**
- * @description: 反序列化
- * @param {uint8_t} *data
- * @param {int} len
- * @param {int} &msg_id
- * @return {*}
- */
- virtual 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);
- /**
- * @description: 构建设备信息
- * @param {SendDevice&} sendDevice
- * @return {*}
- */
- virtual void BuildDeviceInfo(SendDevice& sendDevice);
- /**
- * @description: 序列化
- * @param {GasV1Control} gasV1Control
- * @param {char} *data
- * @return {*}
- */
- static void serialization(const ControlerMsg gasV1Control,char *data);
- /**
- * @description: getParms
- * @return {*}
- */
- httplib::Params getParms();
-
- /**
- * @description: getHeaders
- * @return {*}
- */
- httplib::Headers getHeaders();
- /**
- * @description:
- * @return {*}
- */
- std::string getUrl();
- ~DeviceGasV2(){}
- };
-
- } // namespace gsd
|