1
This commit is contained in:
27
armor/include/CSerialPort/SerialPortInfo.h
Normal file
27
armor/include/CSerialPort/SerialPortInfo.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef CSERIALPORT_SERIALPORTINFO_H
|
||||
#define CSERIALPORT_SERIALPORTINFO_H
|
||||
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
|
||||
namespace itas109 {
|
||||
|
||||
struct SerialPortInfo {
|
||||
char portName[256];
|
||||
char description[256];
|
||||
|
||||
SerialPortInfo() {
|
||||
std::memset(portName, 0, sizeof(portName));
|
||||
std::memset(description, 0, sizeof(description));
|
||||
}
|
||||
};
|
||||
|
||||
class CSerialPortInfo {
|
||||
public:
|
||||
// 枚举系统上所有可用串口
|
||||
static std::vector<SerialPortInfo> availablePortInfos();
|
||||
};
|
||||
|
||||
} // namespace itas109
|
||||
|
||||
#endif // CSERIALPORT_SERIALPORTINFO_H
|
||||
Reference in New Issue
Block a user