On Fri, Jan 28, 2011 at 09:33:50AM +0700, Serge Stinckwich wrote:
On Fri, Jan 28, 2011 at 9:12 AM, David T. Lewis <lewis@mail.msen.com> wrote:
On Wed, Jan 26, 2011 at 03:09:14PM +0000, pharo@googlecode.com wrote:
Status: Accepted Owner: stephane...@gmail.com Labels: Milestone-1.3
New issue 3599 by stephane...@gmail.com: Serial Port http://code.google.com/p/pharo/issues/detail?id=3599
Hello We are developing software to interact with small robots for educational purposes. To do this we need to use the serial port. SerialPort class that includes Pharo does not work on mac or linux, because it?s not ?able to open ports by name.
FYI, the primitives for named serial ports are now in the standard VM (maybe not yet in Cog, but it is a small change). If someone would like to test on a Linux platform, try using any recent build of the standard VM or use the latest 4.4.7.2357 unix VM from http://squeakvm.org/unix/.
The image changes to SerialPort are simple. You can either copy changes from Squeak or get the orginal change sets from the Mantis report at http://bugs.squeak.org/view.php?id=7266.
The named serial port work was contributed by Severin Lemaignan <severin.lemaignan@laas.fr> and I helped with some of the integration. Anything that I did is MIT licensed.
Hi David,
there is a issue in the Pharo bug tracker since several months for the integration of this changes into Pharo here: http://code.google.com/p/pharo/issues/detail?id=1057
Could we integrate these changes in 1.2 as there is no licence problems at all. David and S?verin could you sign the licence agreement, just to be sure everything is ok.
Just to be clear, the status of named serial port support is: - VM support for named serial ports is present in the standard VM. - VM support for named serial ports is not yet included in Cog. - Pharo developers should IMO include S?verin's SerialPort changes, but I am not involved in this and there are no changes to SerialPort with my author initials either in Squeak or in the change sets on Mantis 7266. HTH, Dave
The quality of the code is not really good, there is a lot of isString everywhere in order to test if the port is a number or a string regarding the OS platform used:
SerialPort>>close "Close the serial port. Do nothing if the port is not open." port ifNotNil: [port isString ifTrue:[self primClosePortByName: port] ifFalse:[self primClosePort:port]]. port := nil
I think we need to polish it in order maybe to use only strings. Why not used string like 'COM1' for a windows platform and '/dev/ttyS*' for Linux ? Any comments about that ?
Regards, -- Serge Stinckwich UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam Every DSL ends up being Smalltalk http://doesnotunderstand.org/