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

Bergel Alexandre bergel at iam.unibe.ch
Mon Feb 11 11:19:49 UTC 2002


Hello,

> So, for UNIX the serial ports are enumerated from 0, and on Windows
> they are enumerated from 1.  How does it work on the Mac? (sadly I don't
> own a Mac to try it on)
> 
> Is this expected behaviour, or is it going to change in future releases?

1) OPENING SERIAL PORT
----------------------

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.

First, I have open like that (under linux) :

-=-=-=-=-=-=-=-=-=-=-=-=
port:=SerialPort new. "Doesn't work, see next example"
port openPort: 0.
port baudRate: 2400.
port dataBits: 8.
port parityType: 1.
port stopBitsType: 1.
-=-=-=-=-=-=-=-=-=-=-=-=

For me it makes sense to use SerialPort like that.
But after several run of the vm under gdb (an unix debugger), I notice serial port is incorrectly set up. What's up ?

-=-=-=-=-=-=-=-=-=-=-=-=
port:=SerialPort new.  "This example works"
port baudRate: 2400.
port dataBits: 8.
port parityType: 1.
port stopBitsType: 1.
port openPort: 0.
-=-=-=-=-=-=-=-=-=-=-=-=

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.


2) LEGO MINDSTORM
-----------------

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). I will *really* try to determine if I need such modifications for the RCX or not.

Regards,
Alexandre


-- 

_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._

Bergel Alexandre  http://www.iam.unibe.ch/~bergel

^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^



More information about the Squeak-dev mailing list