Mantis - Squeak
Viewing Issue Advanced Details
7266 VM major always 01-12-09 23:43 04-18-10 22:04
skadge  
tim  
normal  
closed 3.11  
fixed  
none    
none  
0007266: SerialPlugin doesn't handle arbitrary nodes names
A quick summary of the issue: today, you can open a serial port in Squeak with "SerialPort new openPort:portNum.". Eg,for portNum = 1, it would map to COM1 under Windows and /dev/ttyS1 under Linux.
That's fine, except that recent Linux kernels don't mount most serial
devices on /dev/ttySxx, but on more specific nodes, like /dev/ttyACMxx
for modems, /dev/ttyUSBxx for certain USB->COM converters, etc.

To circumvent it, I modified the UNIX version of the Serial Port plugin to accept either port numbers or arbitrary paths. I modified
SqueakPlugin.c to introduce new primitive calls (plus their
corresponding "exports" declaration), namely:
EXPORT(sqInt) primitiveSerialPortCloseByName(void);
EXPORT(sqInt) primitiveSerialPortOpenByName(void);
EXPORT(sqInt) primitiveSerialPortReadByName(void);
EXPORT(sqInt) primitiveSerialPortWriteByName(void);

The modifications introduced by the attached patch should be transparent for all the existing code base. New code can access the serial ports either with a port number or with the node path using the same Squeak messages: SerialPort openPort:'/dev/ttyUSB0'.
related to 0007286closed lewis SerialPlugin doesn't handle arbitrary nodes names (image fixes) 
 serialplugin.patch [^] (20,547 bytes) 01-12-09 23:43
 M7266-SerialPortManagingNamedNodes-Sk.1.cs.gz [^] (1,315 bytes) 02-15-09 17:40
 SerialPluginNamedDevices-dtl-M7266.1.cs [^] (5,624 bytes) 04-24-09 02:50
 platforms-Cross-plugins-SerialPlugin-SerialPlugin.h.diff [^] (608 bytes) 04-24-09 02:51
 platforms-unix-plugins-SerialPlugin-sqUnixSerial.c.diff [^] (1,020 bytes) 04-24-09 02:52

Notes
(0012921)
skadge   
01-13-09 08:02   
Squeak change set for the serial port class added.
(0013091)
lewis   
04-24-09 03:00   
Uploaded three additional files that incorporate Severin's changes into VMMaker SerialPlugin. Two patch files are to be applied after Severin's patch, in order to change method signatures to declare pointers properly (fixes pre-existing bug to make SerialPlugin work on 64-bit platforms). These change will require updates to win32 and Mac OS platform support files.

The change set provides a Slang implementation of Severin's new primitives:

Change Set: SerialPluginNamedDevices-dtl-M7266
Date: 21 April 2009
Author: David T. Lewis

Add support for named serial devices for SerialPlugin. The new primitives and support code are by Severin Lemaignan <severin.lemaignan@laas.fr>, with portions reimplemented here by dtl.

Also changes method signatures to declare pointers correctly, permitting SerialPlugin to work on 64-bit host platforms. Additional platform code changes are required to match.

(0013249)
lewis   
08-23-09 01:24   
The SerialPluginNamedDevices-dtl-M7266 change set is now included in VMMaker-dtl.136 on SqueakSource. The platforms/Cross and platforms/unix changes are now in Subversion. Updates for OS X and Windows should be completed soon.

A Unix VM built from the latest VMMaker and Subversion platform sources should now provide support for named serial devices.
(0013250)
lewis   
08-23-09 01:25   
Should be working now, at least for Unix/Linux VMs. Need confirmation from someone who works with USB serial devices.
(0013338)
lewis   
10-04-09 23:09   
No known issues, resolved.