Menu

#28 Error in flush method for android with FPC

Just_idea
closed
nobody
None
5
2023-03-22
2023-02-07
No

There is a call to ioctl in the flush method of the synaser.pas unit when the OS is Android.
The problem is that there is no such method in FPC.
Here is a suggested correction code.

procedure TBlockSerial.Flush;
var
Data : Integer = 1;
begin
{$IFNDEF MSWINDOWS}
{$IFDEF ANDROID}
{$IFNDEF FPC}
ioctl(FHandle, TCSBRK, @Data);
{$ELSE}
FpIOCtl(FHandle, TCSBRK, @Data);
{$ENDIF}
{$ELSE}
SerialCheck(tcdrain(FHandle));
{$ENDIF}
{$ELSE}
SetSynaError(sOK);
if not Flushfilebuffers(FHandle) then
SerialCheck(sErr);
{$ENDIF}
ExceptCheck;
end;

Discussion

  • Geby

    Geby - 2023-03-22
    • status: open --> closed
     
  • Geby

    Geby - 2023-03-22

    Thnaks, fixed as SVN #268

     

Log in to post a comment.

MongoDB Logo MongoDB