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

📄 serialbase.h

📁 这是实际项目中的一个串口通信程序. Makefile通过开关, 可使此程序适用于 Linux 和嵌入式 ARM Linux. 代码注释较多. 是学习UART或Serail Port 通信的一个好例子.
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -