I am new to LiveCode and this forum but not really to programing. I have been writing an application on my Ubuntu Linux system to cater to a few custom electronic projects that communicate through serial. So far my application works perfectly fine on windows systems but has an issue running on linux systems.
Application Test System: Ubuntu Linux 12.10 64bit
Programming system: Livecode 6.1.2 (Windows 7) as well as 6.1.0 (Ubuntu 12.10 64bit)
I have no trouble opening a port using... (Had worse problems with open for binary update)
Code: Select all
put "/dev/ttyUSB0" into myPort
open driver myPort for text update
And once a connection is established it reads fine using...(im reading one character at a time)
the problem comes when there is no more data to being sent to the port from the device, it seems like if there is no data the program just hangs there until more data is available not being able to close or use any buttons. However once there is more data it once again reads fine.
I have a temporary solution by looking for an end character ( the > sign) that i have programed into my electronic device that drops the program out of the read loop. (See code below)
Code: Select all
on ReadLoop
read from driver myPort for 1
if it is not empty then
put it into CurChar
put CurChar after field "Output"
if CurChar <> ">" then send ReadLoop to me in 300 millisecs
end if
end ReadLoop
However there are some cases that i cant do this. Is this a bug or am I just going about reading it in the wrong way for Linux? I have tried many different methods including 'read until EOF', 'read until empty', and 'read for 1 line'.
Any help is greatly appreciated.