home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d523 / serlib.lha / SerLib / Docs / serlib.autodocs < prev    next >
Text File  |  1991-08-05  |  11KB  |  441 lines

  1. TABLE OF CONTENTS
  2.  
  3. serlib.library/AbortIOSer
  4. serlib.library/ChangeData
  5. serlib.library/CheckCD
  6. serlib.library/CheckIOSer
  7. serlib.library/ClearSer
  8. serlib.library/CloseSerial
  9. serlib.library/GetStatus
  10. serlib.library/OpenSerial
  11. serlib.library/ReadSer
  12. serlib.library/RecvSer
  13. serlib.library/SendSer
  14. serlib.library/SerBuffer
  15. serlib.library/WaitSer
  16. serlib.library/WriteSer
  17. serlib.library/AbortIOSer                           serlib.library/AbortIOSer
  18.  
  19.    NAME   
  20.     AbortIOSer -- abort a previous SendSer or RecvSer
  21.  
  22.    SYNOPSIS
  23.     AbortIOSer( serlibdata, which);
  24.                    A0       D0:16
  25.  
  26.     AbortIOSer(struct SerLibdata *, ULONG);
  27.  
  28.    FUNCTION
  29.     AbortIOSer will perform an AbortIO() on a previous SendSer()- or
  30.     RecvSer()-Command.
  31.     By setting the appropriate bit in `which', either the SendSer() or
  32.     RecvSer() is aborted.
  33.  
  34.    INPUTS
  35.     serlibdata  - pointer returned by OpenSerial
  36.     which       - Either `ABORT_SEND' or `ABORT_RECV'
  37.  
  38.    RESULT
  39.     None
  40.  
  41.    SEE ALSO
  42.     OpenSerial(), SendSer(), RecvSer()
  43.  
  44. serlib.library/ChangeData                           serlib.library/ChangeData
  45.  
  46.    NAME   
  47.     ChangeData -- change the serial setup 
  48.  
  49.    SYNOPSIS
  50.     ChangeData( serlibdata, baud, bpc, stop, serFlags )
  51.                     A0       D0  D1:16 D2:16   D3:16
  52.  
  53.     ChangeData( struct SerLibData *, ULONG, UWORD, UWORD, UWORD);
  54.  
  55.    FUNCTION
  56.     Changes the setup of the serial port.
  57.  
  58.    INPUTS
  59.     serlibdata - Pointer returned by OpenSerial()
  60.     baud       - the baud rate at which the port will be operated.
  61.     bpc        - Bits per character (normally `8').
  62.     stop       - number of stop-bits (normally `1', may be `0' through `2')
  63.     serFlags   - Flags for the device.  Entered directly in
  64.                  io_SerFlags of the IOExtSer-structure.  See
  65.                  `devices/serial.h' for values to enter.
  66.  
  67.    RESULT
  68.     None
  69.  
  70.    NOTES
  71.     No sanity-check of the values given to ChangeDate.  So you
  72.     can use a baud rate of 27182 Baud, 20 Bits per character and
  73.     42 stop bits.  There's no telling how serial.device will
  74.     react to such a change-request...
  75.  
  76.    SEE ALSO
  77.     OpenSerial(), devices/serial.h
  78.  
  79. serlib.library/CheckCD                                 serlib.library/CheckCD
  80.  
  81.    NAME   
  82.     CheckCD -- check if the modem has a Carrier detected
  83.  
  84.    SYNOPSIS
  85.     carrier = CheckCD( serlibdata )
  86.       D0                   A0
  87.  
  88.     ULONG CheckCD( struct SerLibData * );
  89.  
  90.    FUNCTION
  91.     Checks if a carrier is detected.
  92.  
  93.    INPUTS
  94.     serlibdata      - pointer returned by OpenSerial()
  95.  
  96.    RESULT
  97.     carrier         - 0 if no carrier, 1 if carrier is detected
  98.  
  99.    NOTES
  100.     If you need both carrier detect and number of bytes, a call
  101.     to GetStatus() and checking in the SerStatus-structure will be
  102.     faster as both SerBuffer() and CheckCD() call GetStatus() internally.
  103.  
  104.    SEE ALSO
  105.     OpenSerial(), GetStatus(), serlib.h, devices/serial.h
  106.  
  107. serlib.library/CheckIOSer                           serlib.library/CheckIOSer
  108.  
  109.    NAME   
  110.     CheckIOSer -- check if a previous RecvSer is finished
  111.  
  112.    SYNOPSIS
  113.     return = CheckIOSer( serlibdata );
  114.       D0                     A0
  115.  
  116.     BOOL CheckIOSer(struct SerLibdata *);
  117.  
  118.    FUNCTION
  119.     CheckIOSer will perform a CheckIO() on a previous RecvSer()-Command.
  120.  
  121.    INPUTS
  122.     serlibdata  - pointer returned by OpenSerial
  123.  
  124.    RESULT
  125.     return      - Return-value of CheckIO()-call.
  126.  
  127.    SEE ALSO
  128.     OpenSerial(), SendSer(), RecvSer(), AbortIOSer()
  129.  
  130. serlib.library/ClearSer                               serlib.library/ClearSer
  131.  
  132.    NAME   
  133.     ClearSer -- Clear the serial buffer
  134.  
  135.    SYNOPSIS
  136.     ClearSer( serlibdata )
  137.                   A0
  138.  
  139.     ClearSer( struct SerLibData *);
  140.  
  141.    FUNCTION
  142.     ClearSer empties out the serial receive buffer by doing a CMD_CLEAR.
  143.  
  144.    INPUTS
  145.     serlibdata  - Pointer returned by OpenSerial()
  146.  
  147.    RESULT
  148.     None
  149.  
  150.    SEE ALSO
  151.     OpenSerial()
  152.  
  153. serlib.library/CloseSerial                         serlib.library/CloseSerial
  154.  
  155.    NAME   
  156.     CloseSerial -- Close the serial.device
  157.  
  158.    SYNOPSIS
  159.     CloseSerial( serlibdata )
  160.                     A0
  161.  
  162.     CloseSerial( struct SerLibData * );
  163.  
  164.    FUNCTION
  165.     After being finished, use this to close the device and free
  166.     all memory allocated.
  167.  
  168.    INPUTS
  169.     serlibdata   - Pointer returned by OpenSerial.
  170.  
  171.    RESULT
  172.     None
  173.  
  174.    NOTES
  175.     No sanity check, better not get the idea to give this one a Null-
  176.     pointer! If the SerLibData-structure should be trashed, it could
  177.     lead to minor problems, too!
  178.  
  179.    SEE ALSO
  180.     OpenSerial(), serlib.h
  181.  
  182. serlib.library/GetStatus                             serlib.library/GetStatus
  183.  
  184.    NAME   
  185.     GetStatus -- get the Status data from the serial port
  186.  
  187.    SYNOPSIS
  188.     GetStatus( serlibdata, serstatus )
  189.                    A0          A1
  190.  
  191.     GetStatus( struct SerLibData *, struct SerStatus *);
  192.  
  193.    FUNCTION
  194.     Gets the status data from the serial port. Additionally, the number
  195.     of bytes in the system's serial buffer are also returned in the
  196.     SerStatus-structure.
  197.  
  198.    INPUTS
  199.     serlibdata     - pointer returned by OpenSerial()
  200.     serstatus      - address of a SerStatus-structure
  201.  
  202.    RESULT
  203.     serstatus      - filled structure
  204.  
  205.    NOTES
  206.     As usual, no sanity check.
  207.  
  208.    SEE ALSO
  209.     OpenSerial(), serlib.h, devices/serial.h
  210.  
  211. serlib.library/OpenSerial                           serlib.library/OpenSerial
  212.  
  213.    NAME   
  214.     OpenSerial -- Open the serial device for access through serlib.library
  215.  
  216.    SYNOPSIS
  217.     serlibdata = OpenSerial( device, unit, baud, bpc, stop, serFlags )
  218.        D0                      A0    D0:16  D1  D2:16 D3:16  D4:16
  219.  
  220.     struct SerLibData *
  221.                 OpenSerial( STRPTR, UWORD, ULONG, UWORD, UWORD, ULONG);
  222.  
  223.    FUNCTION
  224.     This routine attempts to open the serial.device for usage with
  225.     serlib.library.
  226.  
  227.    INPUTS
  228.     device     - the device to be opened.  Normally "serial.device".
  229.                  Change when using internal modems or multiple line
  230.                  serial cards.
  231.     unit       - the unit to open.  Normally `0', other when using a
  232.                  multiple line serial card.
  233.     baud       - the baud rate at which the port will be opened.
  234.     bpc        - Bits per character (normally `8').
  235.     stop       - number of stop-bits (normally `1', may be `0' through `2')
  236.     serFlags   - Flags for opening the device.  Entered directly in
  237.                  io_SerFlags of the IOExtSer-structure.  See
  238.                  `devices/serial.h' for values to enter.
  239.  
  240.    RESULT
  241.     serlibdata - pointer to the SerLibData-structure containing the
  242.                  paramteres for working with the port.  This pointer
  243.                  will be needed for every function call to
  244.                  serlib.library.
  245.  
  246.    NOTES
  247.     No sanity-check of the values given to OpenSerial.  So you
  248.     can use a baud rate of 27182 Baud, 20 Bits per character and
  249.     42 stop bits.  There's no telling how serial.device will
  250.     react to such an open-request...
  251.  
  252.    SEE ALSO
  253.     CloseSerial(), serlib.h, serlibbase.h, devices/serial.h
  254.  
  255. serlib.library/ReadSer                                 serlib.library/ReadSer
  256.  
  257.    NAME   
  258.     ReadSer -- read bytes from the serial port
  259.  
  260.    SYNOPSIS
  261.     number = ReadSer( serlibdata, buffer, max )
  262.       D0                 A0         A1     D0
  263.  
  264.     ULONG ReadSer(struct SerLibdata *, STRPTR, ULONG);
  265.  
  266.    FUNCTION
  267.     Upon calling, ReadSer first checks how many bytes there are still
  268.     left to be read. If 0, it will return right away.
  269.     Otherwise, ReadSer will send a CMD_READ to the serial device with
  270.     IO_SIZE set to the number of bytes unread (or `max' if max is smaller)
  271.     If you get a return value that is equal to `max', you should process
  272.     the data received and then go back and get the rest.
  273.  
  274.    INPUTS
  275.     serlibdata  - pointer returned by OpenSerial
  276.     buffer      - pointer to a block of memory to be filled with data
  277.                   from the serial port
  278.     max         - size of the buffer. A maximum of `max' bytes will be
  279.                   read.
  280.  
  281.    RESULT
  282.     len         - number of bytes read from the port.
  283.  
  284.    NOTES
  285.     You might get in trouble if you set `max' to zero..
  286.  
  287.    SEE ALSO
  288.     OpenSerial()
  289.  
  290. serlib.library/RecvSer                                 serlib.library/RecvSer
  291.  
  292.    NAME   
  293.     RecvSer -- read bytes from the serial port
  294.  
  295.    SYNOPSIS
  296.     RecvSer( serlibdata, buffer, num )
  297.                A0         A1     D0
  298.  
  299.     RecvSer(struct SerLibdata *, STRPTR, ULONG);
  300.  
  301.    FUNCTION
  302.     RecvSer will initiate a SendIO-call to the serial port, trying to
  303.     receive num bytes.
  304.  
  305.    INPUTS
  306.     serlibdata  - pointer returned by OpenSerial
  307.     buffer      - pointer to a block of memory to be filled with data
  308.                   from the serial port
  309.     num         - size of the buffer. `num' bytes will be read if the
  310.                   IORequest isn't aborted.
  311.  
  312.    RESULT
  313.     None
  314.  
  315.    NOTES
  316.     You might get in trouble if you set `num' to zero..
  317.  
  318.    SEE ALSO
  319.     OpenSerial(), ReadSer()
  320.  
  321. serlib.library/SendSer                                 serlib.library/SendSer
  322.  
  323.    NAME   
  324.     SendSer -- Send a string to the serial port without waiting
  325.  
  326.    SYNOPSIS
  327.     SendSer( serlibdata, buffer, len)
  328.                  A0        A1    D0
  329.  
  330.     SendSer( struct SerLibData *, STRPTR, ULONG);
  331.  
  332.    FUNCTION
  333.     SendSer takes a buffer pointer and sends the specified number of bytes
  334.     to the serial port using the SendIO() function, so it doesn't wait for
  335.     completion of the command.
  336.  
  337.    INPUTS
  338.     serlibdata  - Pointer returned by OpenSerial()
  339.     buffer      - Pointer to a memory block containing the data for the
  340.                   serial port
  341.     len         - number of bytes to be sent
  342.  
  343.    RESULT
  344.     None
  345.  
  346.    NOTES
  347.     No sanity check, as usual.
  348.  
  349.    SEE ALSO
  350.     OpenSerial(), WriteSer()
  351.  
  352. serlib.library/SerBuffer                             serlib.library/SerBuffer
  353.  
  354.    NAME   
  355.     SerBuffer -- get the number of bytes still in the buffer
  356.  
  357.    SYNOPSIS
  358.     result = SerBuffer( serlibdata )
  359.       D0                   A0
  360.  
  361.     ULONG SerBuffer(struct SerLibData *)
  362.  
  363.    FUNCTION
  364.     Returns the number of bytes still in the system's serial buffer.
  365.  
  366.    INPUTS
  367.     serlibdata     - pointer returned by OpenSerial()
  368.  
  369.    RESULT
  370.     result         - number of bytes in the buffer
  371.  
  372.    NOTES
  373.     If you need both number of bytes and the carrier detect, a call
  374.     to GetStatus() and checking in the SerStatus-structure will be
  375.     faster as both SerBuffer() and CheckCD() call GetStatus() internally.
  376.  
  377.    BUGS
  378.     Would be hard for this one to have any.
  379.  
  380.    SEE ALSO
  381.     OpenSerial(), GetStatus(), serlib.h
  382.  
  383. serlib.library/WaitSer                                 serlib.library/WaitSer
  384.  
  385.    NAME   
  386.     WaitSer -- wait for data from the serial port
  387.  
  388.    SYNOPSIS
  389.     signal = WaitSer( serlibdata, mask )
  390.       D0                  A0       D0
  391.  
  392.     ULONG WaitSer(struct SerLibData *, ULONG);
  393.  
  394.    FUNCTION
  395.     Waits for a signal bit set. Waits for the one of the serial port,
  396.     plus the ones you specify (timer, break, etc.).
  397.  
  398.    INPUTS
  399.     serlibdata      - Pointer returned by OpenSerial()
  400.     mask            - mask of signals waited for
  401.  
  402.    RESULT
  403.     signal          - set of signals that were active
  404.  
  405.    NOTES
  406.     This function has changed slightly from release 1.1. It doesn't do
  407.     a dummy-Read to the serial port any more, so in order to use it, add an
  408.     extra `RecvSer()' before calling WaitSer().
  409.  
  410.  
  411. serlib.library/WriteSer                               serlib.library/WriteSer
  412.  
  413.    NAME   
  414.     WriteSer -- Send a string to the serial port
  415.  
  416.    SYNOPSIS
  417.     WriteSer( serlibdata, buffer, len)
  418.                   A0        A1    D0
  419.  
  420.     WriteSer( struct SerLibData *, STRPTR, ULONG);
  421.  
  422.    FUNCTION
  423.     WriteSer takes a buffer pointer and sends the specified number of bytes
  424.     to the serial port.
  425.  
  426.    INPUTS
  427.     serlibdata  - Pointer returned by OpenSerial()
  428.     buffer      - Pointer to a memory block containing the data for the
  429.                   serial port
  430.     len         - number of bytes to be sent
  431.  
  432.    RESULT
  433.     None
  434.  
  435.    NOTES
  436.     No sanity check, as usual.
  437.  
  438.    SEE ALSO
  439.     OpenSerial()
  440.  
  441.