#pragma once #include "../common/notifier.h" #include #include #include #pragma pack(1) struct Radar_Frame { uint8_t Addr=0x01; uint8_t Func=0x03; uint8_t RegAddr[2]={0x01,0x06}; uint8_t RegData[2]={0x00,0x04}; uint16_t crc; }; struct Radar_Ret { uint8_t Addr=0x01; uint8_t Func=0x03; uint8_t RegAddr={0x06}; uint8_t RegData[8]; uint16_t crc; }; #pragma pack() struct radar_node { // int32_t rid; uint32_t range; int64_t radar_tick=0;//std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();; }; class CMessageQueue; class CRadarSensor//:public ISensorNotify { public: CRadarSensor(CMessageQueue *q); void Notify(int8_t * buffer,int32_t size); void SetSensorSocket(SensorSocket* can); void Start(); void Stop(); void SetChannelReady(bool ret){_channelReady=ret;} const radar_node* GetRadarInfo(){ return _node;} private: private: CMessageQueue* _message; SensorSocket * _socket; //std::mutex _lock; //int32_t _info[7]={-1,-1,-1,-1,-1,-1,-1}; bool _channelReady; radar_node _node[7]; int64_t _tick=0; int16_t mask=0x0; };