Re: [Synalist] Compiling Synapse for Android fails

2018-04-13 Thread Wayne Sherman via synalist-public
A patch was sent to this email list on 2012-JAN-16 which provided a fix for
the rate constants on ARM:

https://sourceforge.net/p/synalist/mailman/message/28681870/

I haven't tested this, but here is the relevant part:

Index: synaser.pas
===
--- synaser.pas (revision 137)
+++ synaser.pas (working copy)
@@ -200,7 +200,11 @@
   {$IFDEF DARWIN}
   MaxRates = 18;  //MAC
   {$ELSE}
-   MaxRates = 30; //UNIX
+{$IFDEF CPUARM}
+MaxRates = 19; //UNIX
+{$ELSE}
+MaxRates = 30; //UNIX
+{$ENDIF}
   {$ENDIF}
 {$ELSE}
   MaxRates = 19;  //WIN
@@ -229,6 +233,7 @@
 {$IFNDEF DARWIN}
 ,(460800, B460800)
   {$IFDEF UNIX}
+{$IFNDEF CPUARM}
 ,(50, B50),
 (576000, B576000),
 (921600, B921600),
@@ -240,6 +245,7 @@
 (300, B300),
 (350, B350),
 (400, B400)
+{$ENDIF}
   {$ENDIF}
 {$ENDIF}
 );
@@ -1938,7 +1944,7 @@
 {$IFDEF DARWIN}
 SerialCheck(fpioctl(FHandle, TCIOflush, TCIOFLUSH));
 {$ELSE}
-SerialCheck(fpioctl(FHandle, TCFLSH, TCIOFLUSH));
+SerialCheck(fpioctl(FHandle, TCFLSH, Pointer(TCIOFLUSH)));
 {$ENDIF}
   {$ENDIF}
   FBuffer := '';
@@ -2336,4 +2342,4 @@
 end;
 {$ENDIF}

-end.
+end.
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public


[Synalist] Compiling Synapse for Android fails

2018-04-13 Thread Wayne Sherman via synalist-public
Running Lazarus on Linux configured to target Android on ARM.

synaser.pas [r207] failed to compile due to missing rate constants which
are found in ./fpc/rtl/linux/termios.inc.  Adjusting two IFDEF from UNIX to
LINUX allows it to compile (and TTCPBlockSocket works btw on Android).

According to http://wiki.freepascal.org/Android :
The compiler does NOT define LINUX during compilation! It defines UNIX and
ANDROID though.


--- ./synaser.pas 2017-06-07 07:53:38.0
+++ ./synaser_edited.pas 2018-04-13 13:20:29.0
@@ -193,17 +193,17 @@
 EvtChar: CHAR;
 wReserved1: Word;
   end;
   PDCB = ^TDCB;

 const
-{$IFDEF UNIX}
+{$IFDEF LINUX}
   {$IFDEF BSD}
   MaxRates = 18;  //MAC
   {$ELSE}
-   MaxRates = 30; //UNIX
+   MaxRates = 30; //LINUX
   {$ENDIF}
 {$ELSE}
   MaxRates = 19;  //WIN
 {$ENDIF}
   Rates: array[0..MaxRates, 0..1] of cardinal =
   (
@@ -225,13 +225,13 @@
 (38400, B38400),
 (57600, B57600),
 (115200, B115200),
 (230400, B230400)
 {$IFNDEF BSD}
 ,(460800, B460800)
-  {$IFDEF UNIX}
+  {$IFDEF LINUX}
 ,(50, B50),
 (576000, B576000),
 (921600, B921600),
 (100, B100),
 (1152000, B1152000),
 (150, B150),
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public


Re: [Synalist] Compiling Synapse for Android fails

2018-04-13 Thread Wayne Sherman via synalist-public
Did a little more checking.  The file ./fpc/rtl/linux/termios.inc is still
used when compiling for Android, but when compiling for ARM the list of
rates is:

{$ifdef cpuarm}
..
{c_cflag bits}
..
   B0  = $000;
   B50 = $001;
   B75 = $002;
   B110= $003;
   B134= $004;
   B150= $005;
   B200= $006;
   B300= $007;
   B600= $008;
   B1200   = $009;
   B1800   = $00A;
   B2400   = $00B;
   B4800   = $00C;
   B9600   = $00D;
   B19200  = $00E;
   B38400  = $00F;
   B57600  = $0001001;
   B115200 = $0001002;
   B230400 = $0001003;
   B460800 = $0001004;
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public