[plt-scheme] serial port in windows
One more thing in linux initial response from device is :
65841010 (ver 4.1.5) instead of 65841310 (ver 4.2.)
Instead of carriage return it produces newline .
Since i am using (read-byte in) , it should produce 13
instead of 10.
By any chance when i do (write-bytes #"dt\r" out) in window does
scheme changes \r to something else.
On Tue, May 19, 2009 at 12:14 AM, Veer <diggerrrrr at gmail.com> wrote:
> 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?
>>
>>
>