cordova-plugin-ble-central icon indicating copy to clipboard operation
cordova-plugin-ble-central copied to clipboard

Use API level 33 BLE functions (read, write & events)

Open peitschie opened this issue 2 years ago • 3 comments

Introduced in API level 33: https://developer.android.com/reference/android/bluetooth/BluetoothGatt#writeCharacteristic(android.bluetooth.BluetoothGattCharacteristic,%20byte[],%20int)

The previous writeCharacteristic method has been deprecated, and now carries this warning:

This method was deprecated in API level 33. Use BluetoothGatt#writeCharacteristic(BluetoothGattCharacteristic, byte[], int) as this is not memory safe because it relies on a BluetoothGattCharacteristic object whose underlying fields are subject to change outside this method.

peitschie avatar Aug 15 '23 02:08 peitschie

A good example of this implementation is at https://github.com/capacitor-community/bluetooth-le/pull/572

peitschie avatar Nov 03 '23 23:11 peitschie

Example code snippet in #997

peitschie avatar Nov 17 '23 22:11 peitschie

Also relates to https://github.com/don/cordova-plugin-ble-central/issues/1006

peitschie avatar Mar 12 '24 22:03 peitschie