Chipsets/Devices supporting Android 5 BLE peripheral mode

The Android 5.0.X will only allow you to use the new API for BLE. This new API comes with a new feature, which you mentioned in your question: The possibility of advertising, from your own Android device, using it in Peripheral mode. However, the disadvantaged of this new feature is that it is hardware dependent. … Read more

Programmatically pairing with a BLE device on Android 4.4+

I almost have it working. It pairs programmatically but I can’t get rid of the “Pairing request” notification. Some answers to this question claim to be able to hide it just after it is shown using the hidden method cancelPairingUserInput() but that doesn’t seem to work for me. Edit: Success! I eventually resorted to reading … Read more

Node.js – how to set environment variables in code

You can not only consume environment variables in node with process.env but also set them. This will set the variable within your current node process and any child processes it calls, but not the calling shell itself. // consume var alreadySetEnvVarForDevice = process.env.NOBLE_HCI_DEVICE_ID // set process.env[‘NOBLE_HCI_DEVICE_ID’] = 1

‘App is scanning too frequently’ with ScanSettings.SCAN_MODE_OPPORTUNISTIC

Android 7 prevents scan start-stops more than 5 times in 30 seconds. The bad side is, it doesn’t return an error, instead just prints a log. The app thinks the scan is started but it’s not actually started back at the ble stack. Also it converts long running scans to opportunistic scan with an intent … Read more

How to programmatically force bluetooth low energy service discovery on Android without using cache

I just had the same problem. If you see the source code of BluetoothGatt.java you can see that there is a method called refresh() /** * Clears the internal cache and forces a refresh of the services from the * remote device. * @hide */ public boolean refresh() { if (DBG) Log.d(TAG, “refresh() – device: … Read more

Bluetooth Low Energy: listening for notifications/indications in linux

Try this… Run gatttool -b <MAC Address> –interactive like you did before. You’ll get a prompt and then you type connect. You should see a CON in the prompt indicating that you’ve connected to the device. Then type char-read-uuid 2902. You should get a list of all CCC (Client Characteristic Configuration) attributes on the device. … Read more

Communicating between iOS and Android with Bluetooth LE

I’ve already gone through this for at least one week having this same issue. I’ve already asked a question here and I’ve already answered on my own. The main problem is an Android BUG issue. It’s sending a non permitted command on a fixed L2CAP channnel. But when Android is communicating with normal peripheral BLE … Read more