[Newbies] Serial port write freezes the VM

Hi,
I'm developing a mod for Scratch that will allow controlling an educational
robot via Bluetooth. I'm using SerialPort2 class that is included in Scratch
plugin and allows opening ports by name. Everything works fine BUT, when I
send commands in a loop, and the connection is lost (i.e. the robot was
powered off), the VM freezes. I tried forking the port nextPutAll like that:
timer := Delay forMilliseconds: 1000.
port := SerialPort2 new.
port openPortNamed:'COM14' baud:57600.
process := [port nextPutAll:'test'. Transcript show:'port'.] forkAt: 1.
[timer wait. Transcript show:'delay'. process terminate.] forkAt: 7.
but with no result. Is there any way to write to a serial port with timeout?
mactro
--
View this message in context: http://forum.world.st/Serial-port-write-freezes-the-VM-tp4707333.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.