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.

29 lines
821 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __TRANSPORT_SERIAL_HEADERS__
  2. #define __TRANSPORT_SERIAL_HEADERS__
  3. #include "../../components/base/basicDualThread.h"
  4. #include "../../components/base/basicTransport.h"
  5. #define MAXIMAL_SERIAL_PACKET_LENGTH 1024
  6. class transportSerial: public basicTransport, public basicDualThread {
  7. private:
  8. basicLogCollection *m_pLog;
  9. void m_fThreadAProc(void);
  10. void m_fThreadBProc(void);
  11. protected:
  12. U8 *m_pInputBuffer;
  13. int m_nInputBufferSize;
  14. U8 *m_pOutputBuffer;
  15. int m_nOutputBufferSize;
  16. virtual int sendBlock(unsigned char *Data, int DataSize){ return 0;};
  17. virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0;};
  18. public:
  19. transportSerial();
  20. ~transportSerial();
  21. bool sendData( unsigned char *Data, int DataSize );
  22. };
  23. #endif