cordova-plugin-ble-peripheral
cordova-plugin-ble-peripheral copied to clipboard
Hello problem startingAdvertising on Android 8 devices
Hello!
Does anyone have a workaround to Android 8 devices?
I try to create a service like the given example, on Android 7 devices work great, on Android 8 devices is not working at all. When I try to search for the service created I got no result.
Motorola G5 Version 8.0.1
Thanks for your help!
Sincerely, Elysio
I can confirm. Same problem on Samsung Galaxy 8 (android v8.0.0). Central -> ESP32 (standard BLE uart example) Peripheral -> Samsung Galaxy 8 (android v8.0.0) running UART example from this repository (defect in 'blePeripheral.startAdvertising(SERVICE_UUID, 'UART')' ).
@don ,can you please help? Many thanks in advance.
Best regards, Raymond
I found that my bluetooth device name was too big for the advertising data. Once I changed that I could get it to work.
You can also check the value of the failure returned at https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback
1 was my error code and it was mapped to https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetCallback.html#ADVERTISE_FAILED_DATA_TOO_LARGE
Thank you. You really saved my day. Setting
builder.setIncludeDeviceName(false);
in the private AdvertiseData getAdvertisementData
declaration in BLEPeripheralPlugin.java
did indeed make everything work.
THANK YOU !!!