CommInterface.h 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // CommInterface.h: interface for the CCommProcess class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_COMMINTERFACE_H__MOSTDEVICE__INCLUDED_)
  5. #define AFX_COMMINTERFACE_H__MOSTDEVICE__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "CommProcess.h"
  10. typedef struct __COM_STRUCT
  11. {
  12. int nCommPort;
  13. CCommProcess* pComm;
  14. }COM_STRUCT, *PCOM_STRUCT;
  15. class CCommInterface
  16. {
  17. private:
  18. public:
  19. list<COM_STRUCT> m_listComm;
  20. public:
  21. CCommInterface();
  22. virtual ~CCommInterface();
  23. private:
  24. protected:
  25. // 打开串口
  26. BOOL OpenComm(int nCommPort, int nAddr, int nRate, int nDataBit, int nStopBit, int nParity, int nInterval);
  27. // 关闭串口
  28. BOOL CloseComm();
  29. // 查找串口,没找到返回NULL
  30. CCommProcess* FindComm(int nCommPort);
  31. };
  32. #endif