資源簡介
linux下串口、網口數據交換,程序源碼詳細
代碼片段和文件信息
#include?“comdev.h“
/***********************************************************
Function?Name:?????ComOpen
Brief:?????????????open?Serail?Port??
Parameters:????????port?(char?*)?string?of?the?port
Return:????????????int
*************************************************************/
int?ComOpen(unsigned?char?*port)
{
???int?fd;?
???
???fd?=?open(port?O_RDWR|O_NOCTTY);?//|O_NDELAY
???if(fd==-1){
??????//perror(“ArmCom:???Can‘t?Open?Com?Port“);
??????return(-1);
???}
???return?fd;
}
/****************************************************************
Function?Name: ???ComSetBaud
Brief: ???????????Set?Baudrate?of?Serial?Port?
Parameters:????????fd?(int)?handler?of?the?file?opened
Parameters:????????baud?(int)?baudrate?of?setting
Return:????????????void
*******
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6459??2007-10-24?10:42??s2t\comdev.c
?????文件????????632??2007-08-06?15:43??s2t\comdev.h
?????文件???????2044??2007-08-12?00:49??s2t\main.c
?????文件???????1298??2007-08-06?16:12??s2t\Makefile
?????目錄??????????0??2007-10-24?10:42??s2t
-----------?---------??----------?-----??----
????????????????10433????????????????????5
- 上一篇:跟蹤中心軌跡內點法最優潮流程序,算無功優化
- 下一篇:基于FPGA的PS/2鍵盤控制
評論
共有 條評論