pcplayer99 11 Posted August 13, 2019 Delphi 10.3.1 My steps: 1. BluetoothLE1.DiscoverDevices(3000); Can find device, trigger BluetoothLE1EndDiscoverDevices event. 2. FDevice.DiscoverServices; can get services. I can got a service by: AService := BluetoothLE1.GetService(FDevice, MyService_ID); 3. and then if I call: ACharacteristic := BluetoothLE1.GetCharacteristic(AService, My_Characteristic_ID); I got nil. ----------- at 3, this method will be ok: for I := 0 to AService.Characteristics.Count -1 do begin if Aservice.Characteristics.UUID = My_Characteristic_ID then begin ACharacteristic := Aservice.Characteristics; Break; end; end; After I do this for loop, ACharacteristic := BluetoothLE1.GetCharacteristic(AService, My_Characteristic_ID); will get the right thing. So, Is it a issue? Share this post Link to post
Dave Nottage 557 Posted August 13, 2019 42 minutes ago, pcplayer99 said: So, Is it a issue? From the documentation: http://docwiki.embarcadero.com/Libraries/Rio/en/System.Bluetooth.Components.TBluetoothLE.GetCharacteristic "Warning: You must read the value of the AService.Characteristics property before you call GetCharacteristic. Otherwise, GetCharacteristic returns nil." Share this post Link to post