don/cordova-plugin-ble-central

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

peitschie opened this issue · 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.

A good example of this implementation is at capacitor-community/bluetooth-le#572

Example code snippet in #997