home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
SOFTWARE
/
LIBS
/
PCL4C43.ZIP
/
PCL4CREF.DOC
(
.txt
)
< prev
next >
Wrap
Text File
|
1995-03-14
|
56KB
|
1,633 lines
Personal Communications Library
For the C Language
(PCL4C)
REFERENCE MANUAL
Version 4.3
March 15, 1995
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 1994
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815
Voice 205-881-4630
FAX 205|880|0925
BBS 205-880-9748
_______
____|__ | (R)
--+ | +-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
--+--+ | +---------------------
|___|___| MEMBER
PCL4C Reference Manual Page 1
C O N T E N T S
Chapter Page
Table of Contents.............................2
Introduction..................................3
SioBaud....................................4
SioBrkKey..................................4
SioBrkSig..................................5
SioCrtWrite................................5
SioCTS.....................................6
SioDCD.....................................6
SioDelay...................................7
SioDone....................................7
SioDSR.....................................8
SioDTR.....................................8
SioError...................................9
SioFIFO....................................9
SioFlow...................................10
SioGetc...................................10
SioGetDiv.................................11
SioKeyPress...............................11
SioKeyRead................................12
SioInfo...................................12
SioIRQ....................................13
SioLine...................................13
SioLoopBack...............................14
SioModem..................................14
SioParms..................................15
SioPorts..................................15
SioPutc...................................16
SioRead...................................16
SioReset..................................17
SioRI.....................................17
SioRTS....................................18
SioRxBuf..................................18
SioRxFlush................................19
SioRxQue..................................19
SioTimer..................................20
SioTxBuf..................................20
SioTxFlush................................21
SioTxQue..................................21
SioUART...................................22
SioUnGetc.................................22
Function Summary.............................23
Error Code Summary...........................24
Code Examples................................24
PCL4C Reference Manual Page 2
Introduction
This manual lists all of the PCL4C functions in alphabetical order. Every
library function will return a value as follows:
1. Negative values for error conditions. See last page of this manual for
a list of error values and their meanings.
2. Non-negative values when returning data (eg: SioLine).
3. Zero otherwise.
When debugging an application, be sure to test all return values. Use
SioError to print the associated text for errors.
Example Code Segment
+---------------------------------------------------------------+
| int Code; /* MUST be 'int', not 'char' */ |
| |
| Code = SioFunction( ); /* any PCL4C function */ |
| if(Code<0) |
| {/* error returned */ |
| SioError(Code); /* SioError prints error text */ |
| SioDone(Port); /* always call SioDone last */ |
| exit(1); |
| } |
| /* no errors */ |
| ...your application code... |
| |
+---------------------------------------------------------------+
For more examples, examine each of the example programs provided (SIMPLE.C
and TERM.C). Also look at the examples associated with each library function
described in the following section.
Also note that there are two versions of the library for each memory model.
One version is with transmitter interrupts disabled and one with them
enabled.
Refer to the User's Manual (PCL4C.USR) for addition information.
PCL4C Reference Manual Page 3
+-------------+------------------------------------------------------------+
| SioBaud | Sets the baud rate of the selected port. |
+-------------+------------------------------------------------------------+
Syntax int SioBaud(int Port,int BaudCode)
/* Port: Port selected (COM1 - COM16) */
/* BaudCode: Baud code */
Remarks The SioBaud function sets the baud rate without resetting the
port. It is used to change the baud rate after calling SioReset.
Code Rate Name Code Rate Name
0 300 Baud300 5 9600 Baud9600
1 600 Baud600 6 19200 Baud19200
2 1200 Baud1200 7 38400 Baud38400
3 2400 Baud2400 8 57600 Baud57600
4 4800 Baud4800 9 115200 Baud115200
Returns -4 : No such port. Expect 0 to MaxPort.
-11 : Bad baud rate code. See above code values.
See Also SioReset
+-------------+------------+-------------------+---------------------------+
| SioBrkKey | Return non|zero if the Control|Break key was pressed. |
+-------------+------------+-------------------+---------------------------+
Syntax int SioBrkKey(void)
Remarks The SioBrkKey function returns a TRUE value (non-zero) if the
Control-BREAK key was pressed, else it returns a zero. Use
SioBrkKey as a safety exit from a polling loop. Don't mix this
function up with SioBrkSig.
Returns -1 : Control-BREAK was pressed.
0 : Control-BREAK was NOT pressed.
See Also SioBrkSig
PCL4C Reference Manual Page 4
+-------------+------------------------------------------------------------+
| SioBrkSig | Asserts, cancels, or detects BREAK signal. |
+-------------+------------------------------------------------------------+
Syntax int SioBrkSig(int Port,char Cmd)
/* Port: Port selected (COM