startLeScan with 128 bit UUIDs doesn’t work on native Android BLE implementation

@Navin’s code is good, but it includes an overflow bug from the original 16-bit Android code. (If either byte is larger than 127 then it becomes a negative integer.) Here’s an implementation which fixes that bug and adds 128-bit support: private List<UUID> parseUuids(byte[] advertisedData) { List<UUID> uuids = new ArrayList<UUID>(); ByteBuffer buffer = ByteBuffer.wrap(advertisedData).order(ByteOrder.LITTLE_ENDIAN); while … Read more

Android Bluetooth Low Energy Pairing

When you get the GATT_INSUFFICIENT_AUTHENTICATION error, the system starts the bonding process for you. In the example below I’m trying to enable notifications and indications on glucose monitor. First I’m enabling the notifications on Glucose Measurement characteristic which can cause the error to appear. @Override public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { if … 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

Android BLE API: GATT Notification not received

It seems like you forgot to write the Descriptor which tells your BLE device to go in this mode. See the code lines that deal with descriptor at http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#notification Without setting this descriptor, you never receive updates to a characteristic. Calling setCharacteristicNotification is not enough. This is a common mistake. code snipped protected static final … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)