123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef _DEVICEPLAYERV1_HPP_
- #define _DEVICEPLAYERV1_HPP_
- #include "Crc.h"
- #include "UtilBase.hpp"
- namespace gsd{
-
-
- class DevicePlayerV1: public ContorlSerialBase
- {
- private:
- unsigned short voltage;
- short current;
- short pressure;
- uint8_t power_out_state;
- enum RECV_STEP{
- STEP_HEAD = 0,
- STEP_LEN = 1,
- STEP_SEQ = 2,
- STEP_SAddr = 3,
- STEP_DAddr = 4,
- STEP_MSGId = 5,
- STEP_DATA = 6
- };
- typedef struct {
- uint8_t dataCount;
- uint8_t dataLength;
- uint8_t dataCheckSum;
- uint8_t data[15];
- enum RECV_STEP step = STEP_HEAD;
- }ExpelComm;
- ExpelComm _comm;
- public:
- DevicePlayerV1(): ContorlSerialBase()
- {
- this->DeviceInfo = "民航小板协议";
- this->tool = DeviceTools::serial;
- this->baudRate = 115200;
- }
- ~DevicePlayerV1(){}
- unsigned short getVoltage();
- short getCurent();
- short getPressure();
- uint8_t getPowerOutState();
-
-
- bool getStatusMsg(int &msg_id);
-
-
-
- bool Consumer(uint8_t *data, int len, int &msg_id);
-
-
- virtual bool deserialization(const uint8_t *data, int len, int &msg_id);
-
-
- void serialization(const ControlerMsg gasControl, char* data);
-
- 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);
-
-
- virtual void BuildDeviceInfo(SendDevice& sendDevice);
- };
- };
- #endif
|