home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- serlib.library/AbortIOSer
- serlib.library/ChangeData
- serlib.library/CheckCD
- serlib.library/CheckIOSer
- serlib.library/ClearSer
- serlib.library/CloseSerial
- serlib.library/GetStatus
- serlib.library/OpenSerial
- serlib.library/ReadSer
- serlib.library/RecvSer
- serlib.library/SendSer
- serlib.library/SerBuffer
- serlib.library/WaitSer
- serlib.library/WriteSer
- serlib.library/AbortIOSer serlib.library/AbortIOSer
-
- NAME
- AbortIOSer -- abort a previous SendSer or RecvSer
-
- SYNOPSIS
- AbortIOSer( serlibdata, which);
- A0 D0:16
-
- AbortIOSer(struct SerLibdata *, ULONG);
-
- FUNCTION
- AbortIOSer will perform an AbortIO() on a previous SendSer()- or
- RecvSer()-Command.
- By setting the appropriate bit in `which', either the SendSer() or
- RecvSer() is aborted.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial
- which - Either `ABORT_SEND' or `ABORT_RECV'
-
- RESULT
- None
-
- SEE ALSO
- OpenSerial(), SendSer(), RecvSer()
-
- serlib.library/ChangeData serlib.library/ChangeData
-
- NAME
- ChangeData -- change the serial setup
-
- SYNOPSIS
- ChangeData( serlibdata, baud, bpc, stop, serFlags )
- A0 D0 D1:16 D2:16 D3:16
-
- ChangeData( struct SerLibData *, ULONG, UWORD, UWORD, UWORD);
-
- FUNCTION
- Changes the setup of the serial port.
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial()
- baud - the baud rate at which the port will be operated.
- bpc - Bits per character (normally `8').
- stop - number of stop-bits (normally `1', may be `0' through `2')
- serFlags - Flags for the device. Entered directly in
- io_SerFlags of the IOExtSer-structure. See
- `devices/serial.h' for values to enter.
-
- RESULT
- None
-
- NOTES
- No sanity-check of the values given to ChangeDate. So you
- can use a baud rate of 27182 Baud, 20 Bits per character and
- 42 stop bits. There's no telling how serial.device will
- react to such a change-request...
-
- SEE ALSO
- OpenSerial(), devices/serial.h
-
- serlib.library/CheckCD serlib.library/CheckCD
-
- NAME
- CheckCD -- check if the modem has a Carrier detected
-
- SYNOPSIS
- carrier = CheckCD( serlibdata )
- D0 A0
-
- ULONG CheckCD( struct SerLibData * );
-
- FUNCTION
- Checks if a carrier is detected.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial()
-
- RESULT
- carrier - 0 if no carrier, 1 if carrier is detected
-
- NOTES
- If you need both carrier detect and number of bytes, a call
- to GetStatus() and checking in the SerStatus-structure will be
- faster as both SerBuffer() and CheckCD() call GetStatus() internally.
-
- SEE ALSO
- OpenSerial(), GetStatus(), serlib.h, devices/serial.h
-
- serlib.library/CheckIOSer serlib.library/CheckIOSer
-
- NAME
- CheckIOSer -- check if a previous RecvSer is finished
-
- SYNOPSIS
- return = CheckIOSer( serlibdata );
- D0 A0
-
- BOOL CheckIOSer(struct SerLibdata *);
-
- FUNCTION
- CheckIOSer will perform a CheckIO() on a previous RecvSer()-Command.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial
-
- RESULT
- return - Return-value of CheckIO()-call.
-
- SEE ALSO
- OpenSerial(), SendSer(), RecvSer(), AbortIOSer()
-
- serlib.library/ClearSer serlib.library/ClearSer
-
- NAME
- ClearSer -- Clear the serial buffer
-
- SYNOPSIS
- ClearSer( serlibdata )
- A0
-
- ClearSer( struct SerLibData *);
-
- FUNCTION
- ClearSer empties out the serial receive buffer by doing a CMD_CLEAR.
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial()
-
- RESULT
- None
-
- SEE ALSO
- OpenSerial()
-
- serlib.library/CloseSerial serlib.library/CloseSerial
-
- NAME
- CloseSerial -- Close the serial.device
-
- SYNOPSIS
- CloseSerial( serlibdata )
- A0
-
- CloseSerial( struct SerLibData * );
-
- FUNCTION
- After being finished, use this to close the device and free
- all memory allocated.
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial.
-
- RESULT
- None
-
- NOTES
- No sanity check, better not get the idea to give this one a Null-
- pointer! If the SerLibData-structure should be trashed, it could
- lead to minor problems, too!
-
- SEE ALSO
- OpenSerial(), serlib.h
-
- serlib.library/GetStatus serlib.library/GetStatus
-
- NAME
- GetStatus -- get the Status data from the serial port
-
- SYNOPSIS
- GetStatus( serlibdata, serstatus )
- A0 A1
-
- GetStatus( struct SerLibData *, struct SerStatus *);
-
- FUNCTION
- Gets the status data from the serial port. Additionally, the number
- of bytes in the system's serial buffer are also returned in the
- SerStatus-structure.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial()
- serstatus - address of a SerStatus-structure
-
- RESULT
- serstatus - filled structure
-
- NOTES
- As usual, no sanity check.
-
- SEE ALSO
- OpenSerial(), serlib.h, devices/serial.h
-
- serlib.library/OpenSerial serlib.library/OpenSerial
-
- NAME
- OpenSerial -- Open the serial device for access through serlib.library
-
- SYNOPSIS
- serlibdata = OpenSerial( device, unit, baud, bpc, stop, serFlags )
- D0 A0 D0:16 D1 D2:16 D3:16 D4:16
-
- struct SerLibData *
- OpenSerial( STRPTR, UWORD, ULONG, UWORD, UWORD, ULONG);
-
- FUNCTION
- This routine attempts to open the serial.device for usage with
- serlib.library.
-
- INPUTS
- device - the device to be opened. Normally "serial.device".
- Change when using internal modems or multiple line
- serial cards.
- unit - the unit to open. Normally `0', other when using a
- multiple line serial card.
- baud - the baud rate at which the port will be opened.
- bpc - Bits per character (normally `8').
- stop - number of stop-bits (normally `1', may be `0' through `2')
- serFlags - Flags for opening the device. Entered directly in
- io_SerFlags of the IOExtSer-structure. See
- `devices/serial.h' for values to enter.
-
- RESULT
- serlibdata - pointer to the SerLibData-structure containing the
- paramteres for working with the port. This pointer
- will be needed for every function call to
- serlib.library.
-
- NOTES
- No sanity-check of the values given to OpenSerial. So you
- can use a baud rate of 27182 Baud, 20 Bits per character and
- 42 stop bits. There's no telling how serial.device will
- react to such an open-request...
-
- SEE ALSO
- CloseSerial(), serlib.h, serlibbase.h, devices/serial.h
-
- serlib.library/ReadSer serlib.library/ReadSer
-
- NAME
- ReadSer -- read bytes from the serial port
-
- SYNOPSIS
- number = ReadSer( serlibdata, buffer, max )
- D0 A0 A1 D0
-
- ULONG ReadSer(struct SerLibdata *, STRPTR, ULONG);
-
- FUNCTION
- Upon calling, ReadSer first checks how many bytes there are still
- left to be read. If 0, it will return right away.
- Otherwise, ReadSer will send a CMD_READ to the serial device with
- IO_SIZE set to the number of bytes unread (or `max' if max is smaller)
- If you get a return value that is equal to `max', you should process
- the data received and then go back and get the rest.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial
- buffer - pointer to a block of memory to be filled with data
- from the serial port
- max - size of the buffer. A maximum of `max' bytes will be
- read.
-
- RESULT
- len - number of bytes read from the port.
-
- NOTES
- You might get in trouble if you set `max' to zero..
-
- SEE ALSO
- OpenSerial()
-
- serlib.library/RecvSer serlib.library/RecvSer
-
- NAME
- RecvSer -- read bytes from the serial port
-
- SYNOPSIS
- RecvSer( serlibdata, buffer, num )
- A0 A1 D0
-
- RecvSer(struct SerLibdata *, STRPTR, ULONG);
-
- FUNCTION
- RecvSer will initiate a SendIO-call to the serial port, trying to
- receive num bytes.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial
- buffer - pointer to a block of memory to be filled with data
- from the serial port
- num - size of the buffer. `num' bytes will be read if the
- IORequest isn't aborted.
-
- RESULT
- None
-
- NOTES
- You might get in trouble if you set `num' to zero..
-
- SEE ALSO
- OpenSerial(), ReadSer()
-
- serlib.library/SendSer serlib.library/SendSer
-
- NAME
- SendSer -- Send a string to the serial port without waiting
-
- SYNOPSIS
- SendSer( serlibdata, buffer, len)
- A0 A1 D0
-
- SendSer( struct SerLibData *, STRPTR, ULONG);
-
- FUNCTION
- SendSer takes a buffer pointer and sends the specified number of bytes
- to the serial port using the SendIO() function, so it doesn't wait for
- completion of the command.
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial()
- buffer - Pointer to a memory block containing the data for the
- serial port
- len - number of bytes to be sent
-
- RESULT
- None
-
- NOTES
- No sanity check, as usual.
-
- SEE ALSO
- OpenSerial(), WriteSer()
-
- serlib.library/SerBuffer serlib.library/SerBuffer
-
- NAME
- SerBuffer -- get the number of bytes still in the buffer
-
- SYNOPSIS
- result = SerBuffer( serlibdata )
- D0 A0
-
- ULONG SerBuffer(struct SerLibData *)
-
- FUNCTION
- Returns the number of bytes still in the system's serial buffer.
-
- INPUTS
- serlibdata - pointer returned by OpenSerial()
-
- RESULT
- result - number of bytes in the buffer
-
- NOTES
- If you need both number of bytes and the carrier detect, a call
- to GetStatus() and checking in the SerStatus-structure will be
- faster as both SerBuffer() and CheckCD() call GetStatus() internally.
-
- BUGS
- Would be hard for this one to have any.
-
- SEE ALSO
- OpenSerial(), GetStatus(), serlib.h
-
- serlib.library/WaitSer serlib.library/WaitSer
-
- NAME
- WaitSer -- wait for data from the serial port
-
- SYNOPSIS
- signal = WaitSer( serlibdata, mask )
- D0 A0 D0
-
- ULONG WaitSer(struct SerLibData *, ULONG);
-
- FUNCTION
- Waits for a signal bit set. Waits for the one of the serial port,
- plus the ones you specify (timer, break, etc.).
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial()
- mask - mask of signals waited for
-
- RESULT
- signal - set of signals that were active
-
- NOTES
- This function has changed slightly from release 1.1. It doesn't do
- a dummy-Read to the serial port any more, so in order to use it, add an
- extra `RecvSer()' before calling WaitSer().
-
-
- serlib.library/WriteSer serlib.library/WriteSer
-
- NAME
- WriteSer -- Send a string to the serial port
-
- SYNOPSIS
- WriteSer( serlibdata, buffer, len)
- A0 A1 D0
-
- WriteSer( struct SerLibData *, STRPTR, ULONG);
-
- FUNCTION
- WriteSer takes a buffer pointer and sends the specified number of bytes
- to the serial port.
-
- INPUTS
- serlibdata - Pointer returned by OpenSerial()
- buffer - Pointer to a memory block containing the data for the
- serial port
- len - number of bytes to be sent
-
- RESULT
- None
-
- NOTES
- No sanity check, as usual.
-
- SEE ALSO
- OpenSerial()
-
-