[plt-scheme] serial port in windows

From: Veer (diggerrrrr at gmail.com)
Date: Mon May 18 14:44:38 EDT 2009

No , i did tried flush-output many times, it had no effects.
Sample code :

(define (keep-reading in)
   (printf  "~a" (read-byte in))
   (keep-reading in))

(define-values (in out)
   (open-input-output-file "COM2:" #:mode 'binary #:exists 'update))

(define thrd (thread (lambda () (keep-reading in))))

:RUN(interactinon window)
=> 65841310 i.e "AT\r\n"  ; initial rsponse from the device
=>(write-bytes #"dt\r" out) ;command sent by me
=>(flush-output out)
=>
nothing is read back now.


On Tue, May 19, 2009 at 12:02 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Mon, 18 May 2009 23:32:40 +0530, Veer wrote:
>> Thanks , i downloaded the new version , now it does not crashes anymore.
>> Just one more question , if you know the answer :
>> When i write to device eg using (write-bytes #"dt\r" out)  and try to read
>> back from it (read-byte in) , most of the time nothing comes back.
>> Is there special setting for output and input port for serial ports.
>
> Does explicitly flushing the output port (with `flush-output') change
> anything?
>
>


Posted on the users mailing list.