linux下如何导出设备数据?
PC通过串口线与手持设备(linux系统)相连,如何通过运行设备端应用程序,将设备端的数据导出,如运行设备端的应用程序,点击程序中的导出按钮,即可将某文件进行导出?
要是该串口为debug口的话,就比较简单了!
debug口?啥意思,请教一下。。。
一般linux设备都会预留一个串口(debug口)作为系统的默认终端,内核启动之后会启动一个shell并将该shell重定向到该终端上面来作为系统的终端(如stdin,stdout,stderr),这样的话用户就可以通过该终端来对系统进行相应操作。
哦,那如果是你说的debug口的话该如何操作呢?
http://linux.chinaunix.net/techdoc/net/2008/09/12/1031749.shtml
看看这个!
if((pid=fork())==0)
{
fd = open("/dev/tts/0", O_RDWR);
printf("fd %d\n",fd);
struct termios option;
tcgetattr( fd,&option);
//old_option = option ;
cfsetispeed(&option,B115200);
cfsetospeed(&option,B115200);
option.c_cflag |= (CS8 | CLOCAL | CREAD); //stopb
option.c_cflag &= ~PARENB; // None parity
option.c_cflag &= ~CSTOPB; // 1 stop bits
option.c_cflag &= ~CRTSCTS; // Disable hardware flow control
option.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL); // Disable software flow control
option.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG); // Set
相关问答:
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
使用Struts2上传文件,在linux下报错
2009-09-29 14:56:20,801 [org.apache.struts2.interceptor.FileUploadInterceptor]-[ERROR] Processing of multipart/form-data request failed. c:/temp/upload__1dcd07ee_12 ......
Linux不正常关机导致系统坏,请问怎么检查和修复系统?
在刚启动的时候会有提示的。
修复可以靠livecd
或者把基本系统部分重新安装即可
是不是系统编程了read-only的啦?无法往系统写入数据啊?
有的情 ......
小弟最近需要一个用socket获取html文档的代码,但是老是不能获取完整的html源码。原因不明,望高手指点!
C/C++ code:
char *Http_GET(char *host,int port,char *data) //发送GET请求
{
char response[2 ......
我们隶属中科院计算所网络重点实验室(http://www.ict.ac.cn/survey/channel/detail443.asp)基础设施课题组.
现因项目和业务拓展的需要,特需要招聘与项目相关的网络应用工程师1-2名。
具体要求如下。有意者 ......