QT串口编程
uct termios oldtio;
block_num=last_block=0;
fd = open(DEVICE, O_RDWR | O_NOCTTY );
parent->setCounter(fd);
parent->setMsgText("opend device fd::::::");
if (fd setMsgText("open device failed");
// exit(-1);
}
tcgetattr(fd,&oldtio);
set_nc_mode(fd);
printf("Changed to nc mode\n");
/*
res=read(fd,( char *)file_name,32);
parent->setCounter(res);
parent->setMsgText("res is ::::::");
*/
/*
if(res>0){
file_name[res-1]='\0';
printf("Received the file name:%s\n",file_name);
}
else
printf("The received file name is error.\n");
fp=fopen(file_name,"wb");
if(fp==NULL){
printf("Can not creat file %s!\n",file_name);
return;
// exit(-1);
}
else
{
send_ack(fd);
printf("The file %s is created.\nWaitting for the block num and last block size\n",file_name);
}
//set_nc_mode(fd);
//printf("Changed to nc mode\n");
res=read(fd,buf,4);
printf("res=%d\n",res);
printf("Received the block num \n");
for(i=0,block_num=0;i0){
send_ack(fd);
res=read(fd,buf,last_block);
printf("res=%d\n",res);
if(res!=last_block){
printf("Request resend the last block\n");
tcflush(fd, TCIOFLUSH);
resend(fd);
}
else
fwrite(buf,1,last_block,fp);
}
send_ack(fd);
printf("The file transports end\n");
fclose(fp);
printf("close the file\n");
tcsetattr(fd,TCSANOW,&oldtio);
close(fd);
printf("close the serial port\n");
*/
}
QT串口编程_日语学习_外语学习_教育专区。QT串口编程 精心收集的绝佳文档 全部免积分 欢迎下载QT???±à??.txt QT???±à?? [serial.cpp] #include #inclu...
QT串口编程.txt QT串口编程 [serial.cpp] #include #include #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc,argv); ...
QT串口编程 9页 免费 QT 编程 42页 1财富值 QT编程 25页 5财富值 qt核心编程 29页 免费 Qt编程问题 4页 2财富值 QT编程进阶 29页 2财富值 16_QT编程...
Qt串口通信专题教程_信息与通信_工程科技_专业资料。Qt串口通信实例... Qt编写串口通信程序 19页 1下载券 Linux下Qt编程入门 38页 1下载券...
qt下串口开发Demo【新手入手推荐】!_IT/计算机_专业资料。串口Demo... QT串口编程 3页 免费 QT简单的文本查看器教程... 10页 免费 ubuntu下安装...
Qt串口通信教程_IT/计算机_专业资料。Qt串口通信教程yafeilinux Qt 3 > http://www.yafeilinux.com ( : windows xp Qt Creator Linux ) Qt qextserialport...
Qt编写串口通信程序全程图文讲解_计算机软件及应用_IT/计算机_专业资料。Qt编写串口通信程序全程图文讲解Qt 编写串口通信程序全程图文讲解 首先说明我们的编程环境是 ...
qt 串口 实现代码_信息与通信_工程科技_专业资料。主要参考网上的教程,但是多... QT串口编程 7页 免费 线程+定时实现linux下的... 5页 免费 QT代码 暂无...
QT 串口与 51 单片机通信 通过这个小例子主要想说明 QT 怎样进行线程编程的思想,实例如图,好吧,下面是过程 上一个例子我们采用的是手工编写代码的方法,这个例子...
【更新】(2010.12)Qt编写串口通信程序全程图文讲解_计算机软件及应用_IT/...下面我们将讲述详细编程过程,这里我们先给出完整的程序,然后再进行逐句分析。 1....
热门文档