I am just learning about Mac and Unix so this may be just me but I am trying to open a USB comport with Lazarus 9.30.4 and FCP 2.6.0 using Synaser.
This is what I did
procedure TFormMain.ButtonConnectClick(Sender: TObject);
begin
if Connected then
begin
ser.CloseSocket;
ButtonConnect.Caption:='Connect';
Connected:=False
end else
begin
ser.Connect('/dev/cu.usbserial-A4003I59');
Sleep(1000);
ser.Config(StrToInt(FormSettings.EditBaudRate.Text), 8, 'N', 0, False, False); // FTDI Driver uses no stop bits for non-standard baud rates.
ButtonConnect.Caption:='Disconnect';
Connected:=True
end;
end; This was after learning that the tty driver will block on "open" if the Data Carrier Detect line is not high

Now it will return a valid file handle but when flush is called I get a "Communication error 25: Not a typewriter" error. I have traced through the code looking for when the error is returned and it is in the ioctl( ) call in this Synaser function that is called in the Connect() method:
{$IFNDEF MSWINDOWS}
procedure TBlockSerial.Purge;
begin
{$IFNDEF FPC}
SerialCheck(ioctl(FHandle, TCFLSH, TCIOFLUSH));
{$ELSE}
{$IFDEF DARWIN}
SerialCheck(fpioctl(FHandle, TCIOFLUSH, Pointer(PtrInt(TCIOFLUSH)))); << Fixed per another thread here.
{$ELSE}
SerialCheck(fpioctl(FHandle, TCFLSH, Pointer(PtrInt(TCIOFLUSH))));
{$ENDIF}
{$ENDIF}
FBuffer := '';
ExceptCheck;
end;
{$ELSE} What am I doing wrong?
Thanks,
Jim