You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB
C

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//功能:实现串口操作的一些函数
#ifndef COM_CONTROL_FUNCTION_H
#define COM_CONTROL_FUNCTION_H
//查找系统可用的串口号将所有的串口号保存在pPortList数组里
//输出串口数portNumber串口号数组pPortList
//pPortList保存各串口的串口数字
extern BOOL ScanPCCom( int *pPortList, int& portNumber );
//判断串口是否被占有串口可用返回true否则返回false
extern bool OnCheckComPort( const CString& portName );
//功能检测2个串口是否相同相同返回True否则返回false
extern bool CompareTwoComPort( const CString port1, const CString port2 );
//判断串口是否可用
//可用返回true,否则返回false
extern bool CheckComPortCanWork( const CString strPort );
//判断串口是否为空
//串口为空返回true,否则返回false
extern bool CheckComPortIsEmpty( const CString strPort );
//判断串口名称是否正确正确的名称为“串口XX”
//串口名称正确返回true, 否则返回false
extern bool CheckComPortName( const CString strPort );
//从串口数组中进行查找,查找出配置文件设置的串口号
//输入数组portArray数组长度arrLength查找元素itemValue
//输出元素的位置pos
//返回值查找成功返回true否则返回false
extern bool FindItemFromComList( int& pos, const int *portArray, const int& arrLength, const int& itemValue );
const int MaxComPortNumber = 1024;
#endif