serialbase.h

来自「这是实际项目中的一个串口通信程序. Makefile通过开关, 可使此程序适用于」· C头文件 代码 · 共 45 行

H
45
字号
#ifdef __cplusplus
extern "C"
{
#endif

//SerialBase.h
#ifndef _SERIALBASE_H
#define _SERIALBASE_H

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>
#include <pthread.h>
#include <sys/ioctl.h>

#include "MsgQue.h"

int Init(unsigned char szAckCmd[],char szComName[]);
int CleanUp();

int WriteComm(unsigned char* lpBuffer, const unsigned int dwBytesToWrite);
int ReadComm();

int WriteOneMsgIntoQue(unsigned char szMessage[], unsigned int nMegLen);

//int GetAckMessage(pMsgQue* msg);
int GetAckMessage(pMsgQue* msg, unsigned int nTimeout);

int GetRxMessage(pMsgQue* msg);


void* CommWatchPorc(void* pParam);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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