SerialPortInfo.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @file SerialPortInfo.h
  3. * @author itas109 (itas109@qq.com) \n\n
  4. * Blog : https://blog.csdn.net/itas109 \n
  5. * Github : https://github.com/itas109 \n
  6. * QQ Group : 12951803
  7. * @brief the CSerialPortInfo class 串口信息辅助类
  8. * @date 2020-04-29
  9. * @copyright The CSerialPort is Copyright (C) 2021 itas109. \n
  10. * Contact: itas109@qq.com \n\n
  11. * You may use, distribute and copy the CSerialPort under the terms of \n
  12. * GNU Lesser General Public License version 3, which is displayed below.
  13. */
  14. #ifndef __CSERIALPORTINFO_H__
  15. #define __CSERIALPORTINFO_H__
  16. #include "SerialPortInfoBase.h"
  17. #include "SerialPort_global.h"
  18. #include <list>
  19. #include <string>
  20. #include "CSerialPort/SerialPortInfoUnixBase.h"
  21. #define CSERIALPORTINFOBASE CSerialPortInfoUnixBase
  22. namespace itas109
  23. {
  24. /**
  25. * @brief the CSerialPortInfo class 串口信息辅助类
  26. *
  27. */
  28. class DLL_EXPORT CSerialPortInfo
  29. {
  30. public:
  31. /**
  32. * @brief Construct a new CSerialPortInfo object 构造函数
  33. *
  34. */
  35. CSerialPortInfo(){}
  36. /**
  37. * @brief Destroy the CSerialPortInfo object 析构函数
  38. *
  39. */
  40. ~CSerialPortInfo(){}
  41. /**
  42. * @brief availablePortInfos 获取串口信息列表
  43. * @return return available port infolist 返回可用串口名称列表
  44. */
  45. static vector<SerialPortInfo> availablePortInfos(){
  46. return CSERIALPORTINFOBASE::availablePortInfos();
  47. }
  48. };
  49. } // namespace itas109
  50. #endif //__CSERIALPORTINFO_H__