当前位置: 技术问答>linux和unix
串口不能发数据 收正常 达人帮忙看看程序
来源: 互联网 发布时间:2016-02-28
本文导语: 串口不能发数据 收正常 达人帮忙看看程序 #include #include #include #include #include #include #include #include #define BAUDRA...
串口不能发数据 收正常 达人帮忙看看程序
#include
#include
#include
#include
#include
#include
#include
#include
#define BAUDRATE B38400
#define MODEMDEVICE "/dev/ttyS0"
#define _POSIX_SOURCE 1
#define FALSE 0
#define TRUE 1
volatile int STOP=FALSE;
main()
{
int fd,c, res;
struct termios oldtio,newtio;
char buf[255];
fd = open(MODEMDEVICE, O_RDWR | O_NOCTTY );
if (fd
#include
#include
#include
#include
#include
#include
#include
#include
#define BAUDRATE B38400
#define MODEMDEVICE "/dev/ttyS0"
#define _POSIX_SOURCE 1
#define FALSE 0
#define TRUE 1
volatile int STOP=FALSE;
main()
{
int fd,c, res;
struct termios oldtio,newtio;
char buf[255];
fd = open(MODEMDEVICE, O_RDWR | O_NOCTTY );
if (fd