You need to send the command "$01, $01, $08, $00, $00, $10" to the server. However, the server does not receive anything.
I do it like this:
// Connecting to the server, disconnecting.
procedure TAndroidModule1.jButton1Click(Sender: TObject);
begin
if jButton1.Text='Connect' then begin
try
jTCPSocketClient1.SetDataTransferMode(dtmByte); // I don't use it in text mode.
jTCPSocketClient1.ConnectAsync('192.168.1.106', 1024);
except
ShowMessage('Error.');
end;
end else begin
jTCPSocketClient1.CloseConnection();
jButton1.Text:='Connect';
end;
end;
// The connection to the server has succeeded.
procedure TAndroidModule1.jTCPSocketClient1Connected(Sender: TObject);
begin
jButton1.Text:='Disconnect';
end;
// Transfer bytes.
procedure TAndroidModule1.jButton2Click(Sender: TObject);
var
Buf: TDynArrayOfJByte;
begin
if jButton1.Text='Connect' then exit;
SetLength(Buf,6);
Buf[0]:=1;
Buf[1]:=$01;
Buf[2]:=$08;
Buf[3]:=$00;
Buf[4]:=$00;
Buf[5]:=$10;
jTCPSocketClient1.SendBytes(Buf, true);
SetLength(Buf,0);
end;
If the transfer is in text mode, then everything is fine:
procedure TAndroidModule1.jButton3Click(Sender: TObject);
begin
if jButton1.Text='Connect' then exit;
jTCPSocketClient1.SendMessage('11800F');
end;
A client written under WINDOWS based on INDI does not cause problems.
And data from jTCPSocketClient in byte transfer mode simply does not arrive at the server...
What could be my mistake?
If necessary, I can post the client and server code for Windows and the client code for Android.