@Jurassic Pork
procedure TBlockSerial.GetComNr(Value: string);
begin
FComNr := PortIsClosed;
if pos('COM', uppercase(Value)) = 1 then
FComNr := StrToIntdef(copy(Value, 4, Length(Value) - 3), PortIsClosed + 1) - 1;
if pos('/DEV/TTYS', uppercase(Value)) = 1 then
FComNr := StrToIntdef(copy(Value, 10, Length(Value) - 9), PortIsClosed - 1);
end;
I wonder if the FComNr is correctly extracted the length of /DEV/TTYSC0 is 11, and 2 chars will be copied. (11-9).
Anyway the device never can be found because:
$IFNDEF MSWINDOWS}
if FComNr <> PortIsClosed then
FDevice := '/dev/ttyS' + IntToStr(FComNr);
will always produce a FDEVICE string like 'dev/ttys' + number' but not a 'dev/ttysc' + number
I try to modify both procedures to differentiate between different length of device basic names:
I found quite a large variety in the mentioned device list:
/dev/ttySnnn UART serial port device
/dev/ttySAn Strong ARM builtin serial port
/dev/ttySCn SC26xx serial port
/dev/ttySCn SCI serial port
/dev/ttySGn SGI Altix console port
/dev/ttySIn SmartIO Port
/dev/ttySRnnn RIO port
/dev/ttySMXn Motorola i.MX - port
/dev/ttySIOCnn Altix ioC3 serial card