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

Ned Konz ned at bike-nomad.com
Mon Feb 11 16:33:15 UTC 2002


On Monday 11 February 2002 03:19 am, Bergel Alexandre wrote:

> 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.

> 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...

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com



More information about the Squeak-dev mailing list