home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 324.lha / rexxserdev.library_v2.00 / testsend.rexx < prev    next >
OS/2 REXX Batch file  |  1989-12-05  |  1KB  |  38 lines

  1. /* part of another serial port test program.                          */
  2. /* works best when connected to another computer via a null modem.    */
  3. /* first run testrecv in a one CLI; then run testsend in another CLI. */
  4.  
  5. /* open the Rexx support library */
  6.  
  7. signal on break_c
  8. if ~show('L',"rexxsupport.library") then do
  9.    if addlib('rexxsupport.library',0,-30,0) then
  10.       say 'added rexxsupport.library'
  11.    else do;
  12.       say 'support library not available'
  13.       exit 10
  14.       end
  15.    end
  16.  
  17. if ~show( 'L', "rexxserdev.library" ) then do
  18.    if addlib( 'rexxserdev.library', 0, -30, 0 ) then
  19.       say 'added rexxserdev.library'
  20.    else do;
  21.       say 'support library not available'
  22.       exit 10
  23.       end
  24.    end
  25.  
  26. libaddr = serlibbase()
  27. say 'serial library base =' libaddr
  28. dh = seropen( 'serial.device', 0 )
  29. if dh = 0 then say 'serial device not opened'
  30. text = 'send stuff out port again and again.' || '0d'x
  31. say 'calling SerWrite'
  32. do for 500
  33.    if ~serwrite( dh, text, length( text ) ) then say 'nothing written'
  34.     end
  35. break_c:
  36. say 'back from SerWrite'
  37. if serclose( dh ) then say 'serial device closed'
  38.