Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the native Android BLE implementation synchronous in nature?

I remember reading in the "Guide and Hint"-doc to the Samsung BLE API (archived page):

One of the most important concepts of the Samsung F/W and stack is its synchronous nature. That is, if we call for example, writeCharacteristic for a particular characteristic, if it returns true, the next call to any BluetoothGatt or BluetoothGattServer method should be done after the onCharacteristicRead callback is received. This is because the stack is designed to support and process only one GATT call at a time, and if, for example, you call writeCharacteristic or readCharacteristic on any characteristic soon after the first one, it is ignored.

  1. Does that also apply to the native implementation of BLE introduced in Android 4.3?
  2. Samsung API also supports only one connected GATT device at a time. Has this changed in the native API?
like image 431
OneWorld Avatar asked Aug 02 '13 08:08

OneWorld


People also ask

Does Android use BLE?

Android provides built-in platform support for Bluetooth Low Energy (BLE) in the central role and provides APIs that apps can use to discover devices, query for services, and transmit information.

How does BLE send data?

The BLE Send block transmits data or instructions from your Android™ mobile device to a nearby device or sensor using the Bluetooth® Low Energy (BLE) protocol.

What is MTU BLE Android?

The ATT Maximum Transmission Unit (MTU) is the maximum length of an ATT packet. Per the Bluetooth Core Specification, the maximum length of an attribute can be 512 bytes. In reality, it can be slightly larger than this to accommodate the ATT header. On Android, the maximum MTU can be 517 bytes.


1 Answers

Samsung recently published a "migration"-document on the same page I linked in my question. They exactly answer my question while comparing the new native BLE API with the Samsung BLE API:

The synchronous nature of the stack and F/W hasn’t been affected. That is, if we call for example, writeCharacteristic for a particular characteristic, if it returns true, the next call to any BluetoothGatt or BluetoothGattServer method should be done after the onCharacteristicRead callback is received. This is because the stack is designed to support and process only one GATT call at a time, and if, for example, you call writeCharacteristic or readCharacteristic of any characteristic soon after the first one, it is ignored.

like image 92
OneWorld Avatar answered Oct 22 '22 23:10

OneWorld