You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
2.0 KiB

​
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
  1. #ifndef __MOJO_REMOTE_CLIENT_HEADER__
  2. #define __MOJO_REMOTE_CLIENT_HEADER__
  3. #include "../../components/base/basicLogCollection.h"
  4. #include "../../components/base/basicThread.h"
  5. #include "../../data/net/clientPort.h"
  6. #include "../../data/protocol/protocol.h"
  7. #include "../../data/protocol/protocolARGUS_DATA.h"
  8. class mojoKernel;
  9. class mojoRemoteClient: public basicThread, public protocolParser{
  10. private:
  11. basicLogCollection * m_pLog;
  12. mojoKernel * m_pMaster;
  13. clientPort * m_pPort;
  14. basicMutex m_mQueryProtector;
  15. uint32_t m_nQueryMessage;
  16. uint8_t m_bAutomationStage;
  17. bool m_bShutdownCommunication;
  18. bool m_bCommunicationEstablished;
  19. bool m_bRegisteredWithRemotePeer;
  20. bool peer_send_evt( ARGUS_DATA_EVENT *ptr );
  21. bool peer_send_hello( ARGUS_DATA_MOJO_INFO *ptr );
  22. bool peer_send_reg_req( CSTR identity );
  23. bool peer_send_status( ARGUS_DATA_MOJO_STATUS *ptr );
  24. bool peer_send_time_sync_req( ARGUS_DATA_TIME_SYNC_REQ *ptr );
  25. protected:
  26. virtual int packetChecker( U8 *Buffer, size_t BufferSize);
  27. virtual protocolPackage * packetExtractor( U8 *Buffer, size_t BufferSize);
  28. virtual bool packetHandler( protocolPackage *Package );
  29. virtual void m_fThreadProc( void );
  30. public:
  31. explicit mojoRemoteClient( mojoKernel *ptr );
  32. ~mojoRemoteClient();
  33. virtual bool create();
  34. bool createVideoTransferTask( ARGUS_DATA_VIDEO_SEGMENT *ptr );
  35. bool validate();
  36. bool addEvent( EVENT_CONTAINER *ptr );
  37. };
  38. #endif