易截截图软件、单文件、免安装、纯绿色、仅160KB

linux 串口多线程问题 (100)

下面是两个线程,tty_handle是读,tty_test是写(这里主要做一个测试写功能),
add_data_to_link_list主要是把数据加入队列中,但是运行一段时间后发现只是
红色部分为出错的开始,好像写数据开始出错,但是接受线程是正常的

注:当tty stop 发送出去后串口得到一个12字节长的数据,后面数据没有接受到,这是为什么?
write 7 bytes to tty left
write 7 bytes to tty stop
Get data from tty and length is 12 :
[21]
[1]
[42]
[5]
[da]
[41]
[2c]
[1]
[70]
[a8]
[3b]
[ff]

write 7 bytes to tty left

write 7 bytes to tty stop

write 7 bytes to tty left

write 7 bytes to tty stop

write 7 bytes to tty left

write 7 bytes to tty stop

write 7 bytes to tty left


C/C++ code:
/************************************************************************************
* tty_handle() To read the data from tty and write into the queue.
************************************************************************************/
void tty_handle(void )
{
int length;
int k = 0,j=0;
unsigned char buffer[MAX_LEN];

if (DEBUG)
printf("Init tty handle thread\n");
if (fd_tty < 0)
{
printf("The tty port error while handing the tty\n");
exit(1);
}
memset(buffer,


相关问答:

linux环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

linux 下C编程工具问题 请教 - C/C++ / C语言

linux 下C编程 集成开发环境 用什么比较好 
我初步选定 codeblock 
呵呵 还有 在linux 写了一个打印中文的代码,而今天在windows 下查看那个代码 , 是乱码 而后想到先用 EditPlus先进行编辑 然后复制 ......

怎样在linux下部署java工程 - Java / Java相关

怎样把一个完整的java web 工程部署到linux下,应用服务器是:weblogic?谢谢!
把调试好的web项目放到对应的服务器发布目录下就行了

帮顶。

我也正在学习Linux下部署javaweb..

放到tomcat的webapps里面不 ......

linux不能访问access - Java / Java EE

rt,我试了网上直连Acces数据库的方法,windows下没有问题,但是在linux下不行,谁能给点提示?谢谢
你怎么连的?

Acces数据库..
你怎么练的呢?

Java code:

static String DBDRIVER = "sun.jd ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号