[VM][LEGO] Re: SerialPort cross-platform question...

ducasse ducasse at iam.unibe.ch
Mon Feb 11 19:56:20 UTC 2002


Hi ned

Alexandre took really a bazooka approach to solve the problem (debugging the
vm under gdb). However it would be nice that the code in Smalltalk force you
to create and open the serial port in the right order. (I can say that this
was frustrating to see a guy like him having to go so deep for a stupid
ordering of messages. He could not think that this was otherwise and us too
;).)

> 
>> These feature seems a good candidate for a fix. Also, I have lost more than
>> one week for how to open a serial port connection.
> 
> You should have checked the list archives. I've said a number of times that
> you have to set up the parameters _before_ a serial port open (no, that's not
> my fault; it was that way already in the Mac interface).
> 
> Sorry you lost a week.

This is not a problem
But see my previous comment.

> 
>> Of course, parameters are given to SerialPort plugin only when it is
>> opened. Anyway, 1 week lost only for that. I think it should be interesting
>> to throw at least an exception when parameters try to be changed after to
>> open it.
> 
> Easy to do.
> 
>> Also I am working on integration of RCX management for Squeak. Actually, I
>> have a prototype which work, BUT, with some serialplugin fixes (I have
>> remove O_NONBLOCK|O_NOCTTY option for system open function call).
> 
> Why should you need this? Especially the O_NOCTTY bit?
> 
> And the O_NONBLOCK is only going to keep you from being able to open the port
> if you have handshaking enabled but the state is inactive.
> 
> You shouldn't need to modify this.
> 
> Instead, use polling (in a separate Process) and a SharedQueue to communicate
> any characters received. Then assemble them using a Stream until you have
> enough response to deal with.
> 
> I realize this isn't the best way to do things in the Serial world.
> 
> Have you looked at Craig's Flow? I understand he has also tackled the
> SerialPort stuff...




More information about the Squeak-dev mailing list