[Openmcl-devel] Two streams questions

Gary Byers gb at clozure.com
Fri Jul 29 15:42:54 PDT 2016


I have not tried this, looked at the code, or thought about this much,

Does

(defun read-byte-no-hang (s)
   (when (listen s)
     (read-byte s)))

work ?

Note also that a terminal device may be in one of a few "modes: (raw, 
cooked, cbreak) some of which may do line bufferimg (aka "rubout 
handling") inside the tty driver.

On 07/29/2016 02:17 PM, Ron Garret wrote:
> Yes, but I don’t want a socket.  I want to communicate with a serial device by opening /dev/device
>
> On Jul 29, 2016, at 12:59 PM, Karsten Poeck <karsten.poeck at gmail.com> wrote:
>
>> In my port of cl-http i see code like
>>
>> (ccl:make-socket :remote-host host
>>                   :remote-port port
>>                   :type :stream
>>                   :connect :active
>>                   :format :bivalent)
>>
>> This is documented in the manual.
>>
>> In trac I see http://trac.clozure.com/ccl/wiki/VectorStreams as bivalent streams
>>
>> regards
>>
>> Karsten
>>
>>
>> On 29.07.16 21:22, Ron Garret wrote:
>>> 1.  Does CCL natively support bivalent file/device streams?  This:
>>>
>>> ? (apropos 'bivalent)
>>>      BIVALENT
>>>     :BIVALENT,  Value: :BIVALENT
>>> CCL::%BIVALENT-IOBLOCK-READ-U8-BYTE, Def: FUNCTION
>>> CCL::%BIVALENT-LOCKED-IOBLOCK-READ-U8-BYTE, Def: FUNCTION
>>> CCL::%BIVALENT-PRIVATE-IOBLOCK-READ-U8-BYTE, Def: FUNCTION
>>>
>>> seems to hint that it might, but it’s not mentioned in the docs.
>>>
>>> 2.  Is it possible to do the equivalent of read-char-no-hang on a binary stream?  There is no read-byte-no-hang in CL, but is it even possible to implement this at the user level?  How?
>>>
>>> The reason I ask is that I’m trying to read binary data from a serial device and it doesn’t have any way of signally EOF.  It just stops sending data.
>>>
>>> Thanks,
>>> rg
>>>
>>> _______________________________________________
>>> Openmcl-devel mailing list
>>> Openmcl-devel at clozure.com
>>> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>>>
>>
>>
>> _______________________________________________
>> Openmcl-devel mailing list
>> Openmcl-devel at clozure.com
>> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> https://lists.clozure.com/mailman/listinfo/openmcl-devel
>



More information about the Openmcl-devel mailing list