没有合适的资源?快使用搜索试试~ 我知道了~
Serial Programming HOWTO 中英文对照版
4星 · 超过85%的资源 需积分: 9 23 下载量 190 浏览量
2010-10-20
13:59:40
上传
评论
收藏 1004KB PDF 举报
温馨提示
试读
24页
Serial Programming HOWTO 中英文对照版 网上有一个翻译,不过感觉比较生涩,自己翻译了一下,对linux 串口编程有兴趣的可以看下 原来要5分,限时福利,1个月内只要1分,独家自己翻译的,所以大家懂的就赶紧下载,过期调整为3分
资源推荐
资源详情
资源评论
个人认为曾元佑对本文译的不好,使用的是台湾的习惯用语.所以我对文进行了翻译,使得语
言更为自然流畅;改掉了几个原文中的英文语法和拼写的问题,其他保留原汁原味.
术语的翻译,如有不合适请指教,反馈请发我邮箱,我会更新文档:
scarlettsp@163.com
我也很纠结究竟是意译还是直译…定语从句太 NB 了
Terminals : 终端
Port : 端口
Serial : 串口
Timer:计数器,这里不是计时器
Serial Programming HOWTO
Gary Frerking
gary@frerking.org
Peter Baumann
Revision History
Revision 1.01
2001-08-26
Revised by: glf
New maintainer, converted to DocBook
Revision 1.0
1998-01-22
Revised by: phb
Initial document release
This document describes how to program communications with devices over
a serial port on a Linux box.
目录
Serial Programming HOWTO ........................................................................................................... 1
1. Introduction .................................................................................................................................. 3
1.1. Copyright Information(版权信息) ..................................................................................... 3
1.2. Disclaimer(免责声明) ........................................................................................................ 4
1.3. New Versions(新版本) ....................................................................................................... 5
1.4. Credits(工作人员) .............................................................................................................. 5
1.5. Feedback(反馈) .................................................................................................................. 5
2. Getting started .............................................................................................................................. 5
2.1. Debugging .......................................................................................................................... 5
2.2. Port Settings ....................................................................................................................... 8
2.3. Input Concepts for Serial Devices(串行设备的输入的概念) ............................................ 9
2.3.1. Canonical Input Processing(标准输入处理) ......................................................... 10
2.3.2. Non-Canonical Input Processing(非标准的输入处理) ......................................... 11
2.3.3. Asynchronous Input(异步输入) ............................................................................ 11
2.3.4. Waiting for Input from Multiple Sources(从多源等待输入) ................................ 11
3. Program Examples ....................................................................................................................... 12
3.1. Canonical Input Processing .............................................................................................. 13
3.2. Non-Canonical Input Processing ...................................................................................... 16
3.3. Asynchronous Input ......................................................................................................... 19
3.4. Waiting for Input from Multiple Sources ......................................................................... 21
4. Other Sources of Information...................................................................................................... 24
1. Introduction
This is the Linux Serial Programming HOWTO. All about how to program
communications with other devices / computers over a serial line under
Linux. Different techniques are explained: Canonical I/O (only complete
lines are transmitted/received), asyncronous I/O, and waiting for input from
multiple sources.
这是一个 Linux 串口编程的 HOWTO(译者注:乊后简称本文档).所有的内容都是
在 Linux 下如何编写通过串口和别的设备戒者电脑迚行通信的程序.丌同的技巧
呈现:传统的 IO(仅收収完整的行),异步 IO,等待丌同源的输入.
This is the first update to the initial release of the Linux Serial Programming
HOWTO. The primary purpose of this update is to change the author
information and convert the document to DocBook format. In terms of
technical content, very little if anything has changed at this time. Sweeping
changes to the technical content aren't going to happen overnight, but I'll
work on it as much as time allows.
这是本文档最初収布版的第一次更新.这次更新的主要目的是更改作者信息和将
格式转化为 DocBook 格式.就技术内容而言,内容即使更改了也是很少的.在短时
间内技术内容丌会有太多的改变,但是我会抽出尽可能多的时间在这上面.
If you've been waiting in the wings for someone to take over this HOWTO,
you've gotten your wish. Please send me any and all feedback you have, it'd
be very much appreciated.
如果你在旁边等待某人接管这个 HOWTO,那么你已经等到了.非常感谢你収送过
来的任何信息和反馈
All examples were tested using a i386 Linux Kernel 2.0.29.
所有的例子都是在 2.0.29 的内核的 i386 Linux 上测试的
1.1. Copyright Information(版权信息)
This document is copyrighted (c) 1997 Peter Baumann, (c) 2001 Gary
Frerking and is distributed under the terms of the Linux Documentation
Project (LDP) license, stated below.
Unless otherwise stated, Linux HOWTO documents are copyrighted by their
respective authors. Linux HOWTO documents may be reproduced and
distributed in whole or in part, in any medium physical or electronic, as long
as this copyright notice is retained on all copies. Commercial redistribution
is allowed and encouraged; however, the author would like to be notified of
any such distributions.
All translations, derivative works, or aggregate works incorporating any
Linux HOWTO documents must be covered under this copyright notice.
That is, you may not produce a derivative work from a HOWTO and impose
additional restrictions on its distribution. Exceptions to these rules may be
granted under certain conditions; please contact the Linux HOWTO
coordinator at the address given below.
In short, we wish to promote dissemination of this information through as
many channels as possible. However, we do wish to retain copyright on the
HOWTO documents, and would like to be notified of any plans to
redistribute the HOWTOs.
If you have any questions, please contact <linux-howto@metalab.unc.edu>
1.2. Disclaimer(免责声明)
No liability for the contents of this document can be accepted. Use the
concepts, examples and other content at your own risk. As this is a new
edition of this document, there may be errors and inaccuracies, that may of
course be damaging to your system. Proceed with caution, and although this
is highly unlikely, the author(s) do not take any responsibility for that.
All copyrights are held by their by their respective owners, unless
specifically noted otherwise. Use of a term in this document should not be
regarded as affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as
endorsements.
You are strongly recommended to take a backup of your system before
major installation and backups at regular intervals.
1.3. New Versions(新版本)
As previously mentioned, not much is new in terms of technical content yet.
1.4. Credits(工作人员)
The original author thanked Mr. Strudthoff, Michael Carter, Peter
Waltenberg, Antonino Ianella, Greg Hankins, Dave Pfaltzgraff, Sean
Lincolne, Michael Wiedmann, and Adrey Bonar.
1.5. Feedback(反馈)
Feedback is most certainly welcome for this document. Without your
submissions and input, this document wouldn't exist. Please send your
additions, comments and criticisms to the following email
address : <gary@frerking.org>.
2. Getting started
2.1. Debugging
The best way to debug your code is to set up another Linux box, and
connect the two computers via a null-modem cable. Use miniterm (available
from the LDP programmers guide
(ftp://sunsite.unc.edu/pub/Linux/docs/LDP/programmers-guide/lpg-0.4.t
ar.gz in the examples directory) to transmit characters to your Linux box.
Miniterm can be compiled very easily and will transmit all keyboard input
raw over the serial port. Only the define statement #define MODEMDEVICE
"/dev/ttyS0" has to be checked. Set it to ttyS0 for COM1, ttyS1 for COM2,
etc.. It is essential for testing, that all characters are transmitted raw (without
output processing) over the line. To test your connection, start miniterm on
both computers and just type away. The characters input on one computer
should appear on the other computer and vice versa. The input will not be
echoed to the attached screen.
剩余23页未读,继续阅读
资源评论
- inmoptg2014-05-27小弟目前正在接触Linux的,这份资料对小弟很实用,谢谢大大的分享!
- chenmeng112012-12-13还行,不过感觉没什么用处
魔尊moon
- 粉丝: 109
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功