[fpc-pascal] Serial communications: synaser vs FPC's serial unit

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Fri Aug 18 11:34:41 CEST 2017


On 18/08/17 07:45, Graeme Geldenhuys wrote:
> On 2017-08-18 08:15, Mark Morgan Lloyd wrote:> There's a> specific 
> gotcha related to differences in the way Linux and Solaris> handle 
> select(),
> 
> I saw some of those in th serial.pp in FPC trunk. Thanks for the 
> information.

I've got this terrible habit of inserting comments... :-)

>> I'm not aware of a reliable, cross-platform way of getting a complete> 
>> list of all serial-like devices.
> To be honest, this is not much of an issue - more of a nice-to-have. It 
> will only need to be set up once for the application anyway.

This is more of an issue than it used to be since, as a particular 
example, if something like an Arduino resets itself the kernel is likely 
to assign this a new named device. Having to restart an app to track 
this is irritating, but tracking udev (or whatever) events is probably 
overkill.

I'd suggest that a good policy would be to recognise various patterns at 
startup (/dev/ttyS*, /dev/ttyUSB* and so on) and to be prepared to 
accept incrementing numeric suffixes as they appear.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list