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