没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Serial Programming Guide
for
POSIX Operating Systems
5th Edition, 4th Revision
Copyright 1994−2004 by Michael R. Sweet
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no
Invariant Sections, no Front−Cover Texts, and no Back−Cover Texts. A copy of the license is included in
Appendix C, GNU Free Documentation License.
Table of Contents
Introduction.........................................................................................................................................................1
License.....................................................................................................................................................1
Organization.............................................................................................................................................1
Chapter 1, Basics of Serial Communications...................................................................................................3
What Are Serial Communications?.........................................................................................................3
What Is RS−232?.....................................................................................................................................4
Signal Definitions..............................................................................................................................4
Asynchronous Communications..............................................................................................................5
What Are Full Duplex and Half Duplex?..........................................................................................6
Flow Control......................................................................................................................................6
What Is a Break?...............................................................................................................................6
Synchronous Communications................................................................................................................7
Accessing Serial Ports..............................................................................................................................7
Serial Port Files.................................................................................................................................7
Opening a Serial Port........................................................................................................................7
Writing Data to the Port....................................................................................................................8
Reading Data from the Port...............................................................................................................9
Closing a Serial Port..........................................................................................................................9
Chapter 2, Configuring the Serial Port...........................................................................................................11
The POSIX Terminal Interface..............................................................................................................11
Control Options...............................................................................................................................12
Local Options..................................................................................................................................15
Input Options...................................................................................................................................16
Output Options................................................................................................................................18
Control Characters...........................................................................................................................19
Chapter 3, MODEM Communications...........................................................................................................21
What Is a MODEM?..............................................................................................................................21
Communicating With a MODEM..........................................................................................................21
Standard MODEM Commands.......................................................................................................23
Common MODEM Communication Problems...............................................................................23
Chapter 4, Advanced Serial Programming....................................................................................................25
Serial Port IOCTLs................................................................................................................................25
Getting the Control Signals.............................................................................................................26
Setting the Control Signals..............................................................................................................27
Getting the Number of Bytes Available..........................................................................................27
Selecting Input from a Serial Port..........................................................................................................28
The SELECT System Call...............................................................................................................28
Using the SELECT System Call.....................................................................................................28
Using SELECT with the X Intrinsics Library.................................................................................29
Appendix A, Pinouts.........................................................................................................................................31
RS−232 Pinouts.....................................................................................................................................32
RS−422 Pinouts.....................................................................................................................................33
RS−574 (IBM PC/AT) Pinouts..............................................................................................................33
SGI Pinouts............................................................................................................................................34
Appendix B, ASCII Control Codes.................................................................................................................35
Control Codes........................................................................................................................................35
Serial Programming Guide for POSIX Operating Systems
i
Table of Contents
Appendix C, GNU Free Documentation License...........................................................................................37
How to use this License for your documents.........................................................................................42
Appendix D, Change History...........................................................................................................................43
Edition 5, Revision 3.............................................................................................................................43
Serial Programming Guide for POSIX Operating Systems
ii Appendix C, GNU Free Documentation License
Introduction
The Serial Programming Guide for POSIX Operating Systems will teach you how to successfully, efficiently,
and portably program the serial ports on your UNIX® workstation or PC. Each chapter provides programming
examples that use the POSIX (Portable Standard for UNIX) terminal control functions and should work with
very few modifications under IRIX®, HP−UX, SunOS®, Solaris®, Digital UNIX®, Linux®, and most other
UNIX operating systems. The biggest difference between operating systems that you will find is the filenames
used for serial port device and lock files.
License
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no
Invariant Sections, no Front−Cover Texts, and no Back−Cover Texts. A copy of the license is included in
Appendix C, GNU Free Documentation License.
Organization
This guide is organized into the following chapters and appendices:
Chapter 1, Basics of Serial Programming•
Chapter 2, Configuring the Serial Port•
Chapter 3, Talking to MODEMs•
Chapter 4, Advanced Serial Programming•
Appendix A, RS−232 Pinouts•
Appendix B, ASCII Control Codes•
Appendix C, GNU Free Documentation License•
Appendix D, Change History•
Introduction 1
剩余47页未读,继续阅读
资源评论
- drinkingcode2015-04-04谢谢楼主的分享,对于Linux下的串口还是很有帮助的
- qilu08822014-09-17非常经典的资料,谢谢分享
- hutpond2013-04-11对串口编程很有帮助。
11000000
- 粉丝: 83
- 资源: 235
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功