home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff294.lzh / DNet / amiga / doshand / uuser.doc < prev   
Text File  |  1989-12-11  |  2KB  |  67 lines

  1.  
  2.                 UUSER.DOC
  3.  
  4.                 UUSER V1.00 Beta
  5.  
  6.     Currently UUSER: works only with single sessions started
  7.     by Getty (this has to do with how UUSER: deals with carrier
  8.     detect).  THIS WILL BE FIXED.
  9.  
  10.     Openning UUSER:
  11.  
  12.     fopen("UUSER:devicename/unit/options", ...);
  13.  
  14.     Example:
  15.             (suggested)
  16.  
  17.     int  fd = open("UUSER:serial.device/0/R1000", O_RDWR | O_CREAT | O_TRUNC);
  18.  
  19.             (also can do this -- see below for problems using
  20.              stdio to read)
  21.  
  22.     FILE *rfi = fopen("UUSER:serial.device/0/R1000", "r");
  23.     FILE *wfi = fopen("UUSER:serial.device/0/R1000", "w");
  24.  
  25.  
  26.     Features:
  27.  
  28.     * 1K asynchronous write buffer for each file handle.  I.E.
  29.       your write() will return when 1K or less remains to be
  30.       written (UUSER: has a 1K buffer for spooling these per
  31.       file handle)
  32.  
  33.     * selectable read timeout
  34.  
  35.     * read poll
  36.  
  37.     * carrier lost handling
  38.  
  39.     General:
  40.  
  41.     (1) Use Level 1 I/O if you can (read/write)
  42.         read() returns 0 on timeout, -1 on carrier lost
  43.         otherwise, read() returns the immediate number of
  44.         data bytes ready up to the amount you requested.
  45.         (i.e. if you read(0,buf,256) you can get anywhere from
  46.         -1, 0, 1 to 256 back).
  47.  
  48.         write() returns the number you wrote or -1 (lost carrier)
  49.  
  50.         To 'poll' data ready you can read(0, NULL, 0) .. reading
  51.         0 bytes returns 0 (data ready) or -1 (data not ready).
  52.         NOTE: 0 (data ready) will be returned if carrier is lost
  53.         when you read 0 bytes... this is so your program thinks
  54.         data is ready and when it does a real read it finds that
  55.         carrier was lost!
  56.  
  57.     (2) If you want to use Level 2 I/O (stdio) I suggest you use
  58.         it for writing only.  If you really want to use it for
  59.         reading remember that the timeout will cause an EOF
  60.         condition which must be cleared (clrerr()).  And you
  61.         must call ferror() to determine whether an EOF is an
  62.         EOF (timeout()) or an actual error (lost carrier).
  63.  
  64.     REFER TO UUSERDUMP.C for a working source example.
  65.  
  66.  
  67.