site_message_handle.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // Created by Administrator on 2019/1/14.
  3. // 分站发生消息到采集服务器的消息处理
  4. //
  5. #ifndef WORKSPACE_SITE_MESSAGE_HANDLE_H
  6. #define WORKSPACE_SITE_MESSAGE_HANDLE_H
  7. #include "module_service/module_const.h"
  8. class site_message_handle : public singleton_base<site_message_handle>
  9. {
  10. private:
  11. friend class singleton_base<site_message_handle>;
  12. site_message_handle();
  13. public:
  14. // 最后接收分站消息的时间
  15. time_t m_time_last_rec;
  16. public:
  17. private:
  18. /** 解析 分站发送过来的数据中(分站的信息数据)
  19. * @param DataBuffer 接收数据
  20. * @param nLen 接收数据长度
  21. * @param dwConnID 连接关键字
  22. * @param nCurPos 从接收数据的那个位置开始读取数据
  23. * @param reader_id 分站ID
  24. * @return
  25. */
  26. void parse_data_locate_reader(char * DataBuffer, int nLen, int dwConnID,int& nCurPos, int& reader_id );
  27. /** 解析单个卡数据
  28. * @param DataBuffer
  29. * @param nCurPos
  30. * @param reader_id 分站ID
  31. * @param wChr 消息ID
  32. * @param ct_time
  33. * @param pos
  34. * @return 0: 成功
  35. */
  36. int parse_data_locate_card(char * DataBuffer, int reader_id, unsigned short wChr,int& nCurPos, unsigned long long ct_time = 0,int pos = 0);
  37. /**
  38. * 分站电源是否已切换直流电,发送警告
  39. * @param site_id
  40. * @param powerType
  41. */
  42. void reader_power_battery_alarm(unsigned int site_id, int powerType);
  43. };
  44. #endif //WORKSPACE_SITE_MESSAGE_HANDLE_H