我想知道如果我有 UUID 并且已成功连接到 BLE 设备,那么检索 BluetoothGattCharacteristic 的最佳方法是什么?例如,见下文。TIA。
public BluetoothGattCharacteristic retrieveCharacteristic(UUID myUUID) {
BluetoothGattCharacteristic returnChar;
BluetoothGattService myService;
myService = mBluetoothGatt.getService(myUUID);
returnChar = myService.getCharacteristic(myUUID);
return returnChar;
}