Old fashion design for PC-104
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.

54 lines
1.3 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: ProtocolCCC.h
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of ProtocolCCC.h
  13. //----------------------------------------------------------------------------
  14. #ifndef __PROTOCOL__CCC__H__INCLUDED__
  15. #define __PROTOCOL__CCC__H__INCLUDED__
  16. #include "..\..\lglib\Comm\connect.h"
  17. #include "..\..\lglib\Comm\protocol.h"
  18. class CProtocolCCC :
  19. public CProtocol
  20. {
  21. public:
  22. CProtocolCCC();
  23. virtual ~CProtocolCCC();
  24. public:
  25. BOOL Create( CConnection *pCommPort );
  26. void Destroy();
  27. public:
  28. virtual BOOL Write( PBYTE pBuffer, INT nCount, DWORD dwTimeout, BOOL bHost );
  29. virtual BOOL Read( PBYTE *ppBuffer, PINT pCount, DWORD dwTimeout, BOOL bHost );
  30. public:
  31. enum
  32. {
  33. ADDRESS_POS = 0, // position of address byte
  34. ADDRESS_TAG = 0x80,
  35. ADDRESS_MASK = 0x7F,
  36. DATA_POS = 1, // position of data byte
  37. DATA_TAG = 0x40,
  38. DATA_MASK = 0x3F,
  39. COMMAND_SIZE = 2,
  40. };
  41. private:
  42. CConnection *m_pConnection;
  43. BYTE m_pBuffer[ COMMAND_SIZE ];
  44. PBYTE m_pBufferPtr;
  45. INT m_nCount;
  46. };
  47. #endif