Home > Back-end >  Delphi xe 10 official classic bluetooth demo
Delphi xe 10 official classic bluetooth demo

Time:11-15

Classic Bluetooth Basic demo app, beginners Delphi, I found that is changed after the uuid can connect me to the Bluetooth device, and send the data to the Bluetooth device, but the Bluetooth devices to the I phone app to send data to receive less than, if after sending data LData:=FSocket. ReceiveData (100); Data can be collected after it set a time, if you don't set has been collected time mean? When I see a demo with the connection inside to create a process to obtain bluetooth receiving data, but don't know how to not run this section, process here to see don't quite understand, here is to create a process to capture the bluetooth data, ask the master say hook can be used to receive data, but don't understand, is there any player can explain:
The demo path:
Radstudiodemos - code - 2026 - branches - RADStudio_Berlin, Object Pascal, Multi - Device Samples \ Device Sensors and Services, Bluetooth, Classic Bluetooth Basic app
Code:
Procedure TServerConnectionTH. Execute;
Var
Msg: string;
LData: TBytes;
The begin
While not Terminated do
Try
FSocket:=nil;
While not Terminated and (FSocket=nil) do
FSocket:=FServerSocket. Accept (100);
If (FSocket & lt;> Nil) then
The begin
While not Terminated do
The begin
LData:=FSocket. ReceiveData;
If Length (LData) & gt; 0 then
The Synchronize (procedure
The begin
Form1. DisplayR. Lines. The Add (TEncoding. UTF8. Get string (LData));
Form1. DisplayR. GoToTextEnd;
End);
Sleep (100);
end;
end;
Except,
On E: the Exception do
The begin
Msg:=E.M essage.
The Synchronize (procedure
The begin
Form1. DisplayR. Lines. The Add (' server port closed: + Msg);
Form1. DisplayR. GoToTextEnd;
End);
end;
end;
end;

CodePudding user response:

Bluetooth connection under a machine can't use server and client, because the machine can't use the service, so want to use the client receiving, if is two mobile phones can be set up the client sends then server receiving mode, I use this demo, can be achieved

CodePudding user response:

reference 1st floor u013682979 response:
bluetooth connection under a machine can't use server and client, because the machine can't use the service, so want to use the client receiving, if is two mobile phones can be set up the client sends then server receiving mode, I use this demo, can realize
I understand this, the problem is now I want to achieve in the resident a thread has been receiving data, how to do?

CodePudding user response:

This communication has been received

CodePudding user response:

On the ios can get bluetooth MAC address

CodePudding user response:

Or can get broadcast data parsing

CodePudding user response:

I found the program debugging is wrong, don't have to accept,

CodePudding user response:

Excuse me, in the classic Delphi bluetooth demo

ToSend:=TEncoding. UTF8. GetBytes (Edit1. Text);
FSocket. SendData publishes the event (ToSend);
DisplayR. Lines. The Add (' Text Sent ');
This a few words after a successful operation, why not receive message

Is there any way to send characters to the mobile phone or other receiving device or file

CodePudding user response:

Computer bluetooth access phone bluetooth? Mobile phone bluetooth also use classic?
  • Related