[Lazarus] Serial communication??

Bo Berglund bo.berglund at gmail.com
Mon Oct 4 08:17:34 CEST 2010


On Fri, 01 Oct 2010 16:10:52 +0100, Paulo Costa <paco at fe.up.pt> wrote:

>> En/na Bo Berglund ha escrit:
>>
>>> So far most of what has been shown builds on Synaser or similar, which
>>> are blocking systems....
>>
>> Yes, so you put it in a TThread and, when the data is ready, use
>> synchronize to signal the main thread.
>
>
>That is how it is done on the 5dpo component.
>I has been working very nicely for us.
>

Thanks for the suggestion! I have now installed the serial component
of the suite on my Ubuntu Lazarus.
As indicated there is an event for receiving the incoming data even
though that event does not tell how many characters are actually
available. So how do I know how many I can read in from the port?

But there is one strange thing about the way the component works:
I can call the Open method for ttyS0 and there is no error even though
the ttyS0 does not exist...

I run my Ubuntu in a VMWare virtual machine and I had forgotten to add
a serial port to its hardware so there is definitely no such port and
yet there is no indication from the component that it has failed to
open the port.
How come?

Should there not be an exception raised if the wanted port does not
exist?


-- 
Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list