Has anyone successful used synaser on a Mac (Lion)? In Connect it calls Flush
which always fails with "Not a Typewriter" which mean ioctl has invalid
parameters.
{$IFNDEF MSWINDOWS}
procedure TBlockSerial.Purge;
begin
{$IFNDEF FPC}
SerialCheck(ioctl(FHandle, TCFLSH, TCIOFLUSH));
{$ELSE}
{$IFDEF DARWIN}
SerialCheck(ioctl(FHandle, TCIOFLUSH, TCIOFLUSH)); <<<< Fails
{$ELSE}
SerialCheck(fpioctl(FHandle, TCFLSH, Pointer(PtrInt(TCIOFLUSH))));
{$ENDIF}
{$ENDIF}
FBuffer := '';
ExceptCheck;
end;
{$ELSE}
…..
I then tried this:
{$IFNDEF MSWINDOWS}
procedure TBlockSerial.Purge;
var
status: Integer;
begin
{$IFNDEF FPC}
SerialCheck(ioctl(FHandle, TCFLSH, TCIOFLUSH));
{$ELSE}
{$IFDEF DARWIN}
Status := 3;
SerialCheck(fpioctl(FHandle, TCIOFLUSH, @Status));
{$ELSE}
SerialCheck(fpioctl(FHandle, TCFLSH, Pointer(PtrInt(TCIOFLUSH))));
{$ENDIF}
{$ENDIF}
FBuffer := '';
ExceptCheck;
end;
{$ELSE}
….
Same results.
I have seen this:
http://www.lazarus.freepascal.org/index.php?topic=16533.0
***************
Does anyone have a simple example that works on a Mac?
I also tried to follow this example to connect and make the ioctl call to flush
and it fails as well……
https://developer.apple.com/library/mac/#samplecode/SerialPortSample/Listings/SerialPortSample_c.html
I have spent all week googling/searching/experimenting and I am at a loss. I
also have asked on the Lazarus forum with no response….
http://lazarus.freepascal.org/index.php/topic,17705.0.html
I am desperate for help!
Thanks,
Jim Kueneman
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public