主题 : 请问qq2440v3的串口设备文件是哪个? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 763
精华: 1
发帖: 9
金钱: 110 两
威望: 29 点
贡献值: 10 点
综合积分: 38 分
注册时间: 2008-05-26
最后登录: 2009-11-12
楼主  发表于: 2008-07-28 09:37

 请问qq2440v3的串口设备文件是哪个?

好像不是/dev/ttyS0, 而是/dev/tts/0 吧?

同样的读写串口的程序, 我在ubuntu7.10下面运行没有问题, 可是交叉编译后,放到板子上运行,写串口是成功的(我写的设备文件是/dev/tts/0),但是读却没有反应。 我读写的协议是modbus, 那位能指点一下是什么原因? 是不是我的操作或者理解错误?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2008-07-28 10:15
不要和那些名字纠缠,最可靠的办法是在板上运行cat /proc/devices, 找出串口设备对应的Major和minor号,然后到/dev目录下找对应的设备文件
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
2楼  发表于: 2008-07-28 13:14
如果你要读串口有反应,那串口连接那一头需要写入数据才行,对吧
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2008-07-28 15:09
在QQ2440v3上读写串口和在PC Linux环境下读写串口理论上没有区别,只是底层硬件不同,提供给应用程序的系统调用接口都是相同的。
关于串口编程,google一下会比在这里问更有用
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."