⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ffserialexport.h

📁 button of Xp style,provide some infterface of the button control!
💻 H
字号:
#ifndef __FF_SERIAL_EXPORT_H__
#define __FF_SERIAL_EXPORT_H__

BOOL __stdcall	FFPortOpen(int nPort = 1, 
				   int nBaud = 4800,
				   int nParity = NOPARITY,
			       int nByteSize = 8, 
			       int nStopBits = ONESTOPBIT);					//打开端口

BOOL __stdcall	FFPortClose(int nPort);							//关闭端口
	
int	 __stdcall	FFPortReadData( int nPort, void *pDataBuf, int nBufSize );			//读接收缓冲区数据
int	 __stdcall	FFPortSendData( int nPort, const char *pDataBuf, int nSendLen );	//发送数据
BOOL __stdcall	FFPortChangeParity( int nPort, int nParity );						//改变奇偶校验

int	 __stdcall	FFPortGetPortBufDataLen( int nPort, int *pnParityErrCode = NULL );	//取串口缓冲区字节长度
BOOL __stdcall	FFPortIsOpened( int nPort );										//查询是否已经打开串口

void __stdcall	FFPortGetLastErrInfo( int nPort, 
							  int& nErrCode,					
							  LPSTR *lpszErrInfo, 
							  int nSize);						//取最后错误信息

BOOL __stdcall	FFPortSetShareMode( int nPort, BOOL bSharePort );
void __stdcall	FFPortSetAddrMode( int nPort, BOOL bDataFrameAddr );
void __stdcall	FPortSetAddByteLen( int nPort, int nAddrByteLen );

BOOL __stdcall	FFPortSendAndWaitReply(int nPort, 
							   const char *pWriteBuf,	//发送缓冲区
		  					   int nWriteLen,			//发送长度
							   char *pReadBuf,			//接收缓冲区
							   int nReadBufSize,		//接收缓冲区大小
							   int& nReturnDataLen,		//返回数据长度
							   int nMaxWaitFirstByteTime);//最大延时时间

void __stdcall	FFPortClearRxBuf(int nPort);				//清除接收缓冲区
int	 __stdcall	FFPortGetRxBufDataLen(int nPort);			//取接收缓冲区数据长度		

void __stdcall	FFPortSetRxBufSize( int nPort, int nSize );
int	 __stdcall	FFPortGetRxBufSize(int nPort);
void __stdcall	FFPortSetByteInterval( int nPort, int nTime );	//设置接收字节间隔
int	 __stdcall	FFPortGetByteInterval(int nPort);
unsigned char GetCheckSum(unsigned char* pByte,unsigned int nLen);
unsigned short Char4ToShort(unsigned char* psrcBYTE);
#endif //#define __FF_SERIAL_EXPORT_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -