Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid BLE : Retrieve service UUID in onLeScan() callback when advertised from iOS Peripheral
    primarykey
    data
    text
    <p>I am using Nexus 4(4.4 kitkat) as central and iPad as peripheral.Peripheral has a service which it is advertising.The advertising packet has some data(22bytes) + service UUID.When I try to scan for the peripheral from Android, iPad peripheral is discovered.However when I try to get the service UUID from scanRecord parameter in the callback, I could not find it.All I get is the 20byte data which the peripheral is sending.When I try to scan for devices with the UUID I am not able to discover those peripherals.</p> <p>Following is the iOS code to advertise a service.The service id being used is "0000192f-0000-1000-8000-00805f9b34fb"</p> <pre><code>CBUUID *serviceUuid = [CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]; [self.peripheralManager startAdvertising:@{CBAdvertisementDataServiceUUIDsKey : @[serviceUuid], CBAdvertisementDataLocalNameKey:[[BTLEConfigs sharedBTLEConfig] getAdvertizingUUID]}]; </code></pre> <p>The device gets discovered when I scan without service UUID.</p> <pre><code>// Device scan callback. private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, int rssi, final byte[] scanRecord) { runOnUiThread(new Runnable() { @Override public void run() { //-- how to retrieve the service id from scanRecord } }); } }; </code></pre> <p>The services are discovered between two iOS devices but between Android device and iOS peripheral its not working.How to scan a peripheral with 16bit service UUID?Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload