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

SWIFT – BLE communications

The following code is for Swift 3 (XCode 8 Beta 6). It’s an example using the standard UUIDs for serial ports like the ones on some commercial modules. So the declarations for the service and characteristics should look like this: private let UuidSerialService = “6E400001-B5A3-F393-E0A9-E50E24DCCA9E” private let UuidTx = “6E400002-B5A3-F393-E0A9-E50E24DCCA9E” private let UuidRx = “6E400003-B5A3-F393-E0A9-E50E24DCCA9E” … Read more

Android 4.3: How to connect to multiple Bluetooth Low Energy devices

I suspect everyone adding delays is just allowing the BLE system to complete the action you have asked before you submit another one. Android’s BLE system has no form of queueing. If you do BluetoothGatt g; g.writeDescriptor(a); g.writeDescriptor(b); then the first write operation will immediately be overwritten with the second one. Yes it’s really stupid … Read more

Use BlueZ Stack As A Peripheral (Advertiser)

With your Bluetooth dongle plugged in, running the following command will tell you the device name and give its state: $ hciconfig The output should look something like this: hci0: Type: BR/EDR Bus: USB BD Address: 00:01:02:aa:bb:cc ACL MTU: 1021:8 SCO MTU: 64:1 DOWN RX bytes:1000 acl:0 sco:0 events:47 errors:0 TX bytes:1072 acl:0 sco:0 commands:47 … Read more

BlueZ: How to set up a GATT server from the command line

So this is now handled with the new bluetoothctl tool. A gatt table can be set up using this tool as follows:- #bluetoothctl [bluetoothctl] menu gatt [bluetoothctl] register-service 0xFFFF # (Choose yes when asked if primary service) [bluetoothctl] register-characteristic 0xAAAA read # (Select a value of 1 when prompted) [bluetoothctl] register-characteristic 0xBBBB read,write # (Select … Read more