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.

31 lines
891 B

8 years ago
​
​
​
​
​
4 years ago
8 years ago
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
8 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 DEBUG_COMMUNICATION
  6. #define MAXIMAL_SERIAL_PACKET_LENGTH 1024
  7. class transportSerial: public basicTransport, public basicDualThread {
  8. private:
  9. basicLogCollection *m_pLog;
  10. void m_fThreadAProc(void);
  11. void m_fThreadBProc(void);
  12. protected:
  13. U8 * m_pInputBuffer;
  14. int m_nInputBufferSize;
  15. U8 * m_pOutputBuffer;
  16. int m_nOutputBufferSize;
  17. virtual int sendBlock(unsigned char *Data, int DataSize){ return 0;};
  18. virtual int recptBlock(unsigned char *Buffer, int *BufferLength){ return 0;};
  19. public:
  20. transportSerial();
  21. virtual ~transportSerial();
  22. bool sendData( unsigned char *Data, int DataSize );
  23. };
  24. #endif