April 2017
Intermediate to advanced
242 pages
6h 10m
English
This is an important class in the Bluetooth communication which gives an interface to the developer to describe custom tasks performed upon a triggered event. For example, by implementing an onServicesDiscovered method, we can define the tasks to be performed after all the services are discovered. Similarly, onCharacteristicRead can be overridden to perform tasks upon reading a characteristic.
BluetoothGattCallback mBluetoothGattCallback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { super.onConnectionStateChange(gatt, status, newState); } @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { super.onServicesDiscovered(gatt, ...Read now
Unlock full access