[Help]: PlatformException(iosException, Client Characteristic Configuration descriptors must be configured using setNotifyValue:forCharacteristic: )
sulamantcig opened this issue · 1 comments
sulamantcig commented
Requirements
- I've looked at the README 'Common Problems' section
Have you checked this problem on the example app?
Yes
FlutterBluePlus Version
flutter_blue_plus 1.32.12
Flutter Version
Flutter 3.24.0
What OS?
All
OS Version
iOS 16.7.8
Bluetooth Module
N/A
What is your problem?
I couldn't write to fff6 or its descriptor 0x2902 it showed me this error. It shows we should set a notify value for Characteristic.
Logs
flutter: BluetoothConnectionState : Connected
[FBP-iOS] handleMethodCall: discoverServices
[FBP-iOS] didDiscoverServices:
[FBP-iOS] svc: 5833ff01-9b8b-5191-6142-22a4536ef123
[FBP-iOS] svc: fff0
2
flutter: BluetoothConnectionState : Connected
[FBP-iOS] didDiscoverCharacteristicsForService:
[FBP-iOS] svc: 5833ff01-9b8b-5191-6142-22a4536ef123
[FBP-iOS] chr: 5833ff02-9b8b-5191-6142-22a4536ef123
[FBP-iOS] chr: 5833ff03-9b8b-5191-6142-22a4536ef123
[FBP-iOS] didDiscoverCharacteristicsForService:
[FBP-iOS] svc: fff0
[FBP-iOS] chr: fff6
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: 5833ff02-9b8b-5191-6142-22a4536ef123
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: 5833ff03-9b8b-5191-6142-22a4536ef123
[FBP-iOS] desc: 2902
2
flutter: BluetoothConnectionState : Connected
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: fff6
[FBP-iOS] desc: 2902
[FBP-iOS] desc: 2901
[FBP-iOS] handleMethodCall: discoverServices
[FBP-iOS] didDiscoverServices:
[FBP-iOS] svc: 5833ff01-9b8b-5191-6142-22a4536ef123
[FBP-iOS] svc: fff0
[FBP-iOS] didDiscoverCharacteristicsForService:
[FBP-iOS] svc: 5833ff01-9b8b-5191-6142-22a4536ef123
[FBP-iOS] chr: 5833ff02-9b8b-5191-6142-22a4536ef123
[FBP-iOS] chr: 5833ff03-9b8b-5191-6142-22a4536ef123
[FBP-iOS] didDiscoverCharacteristicsForService:
[FBP-iOS] svc: fff0
[FBP-iOS] chr: fff6
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: 5833ff02-9b8b-5191-6142-22a4536ef123
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: 5833ff03-9b8b-5191-6142-22a4536ef123
[FBP-iOS] desc: 2902
[FBP-iOS] didDiscoverDescriptorsForCharacteristic:
[FBP-iOS] chr: fff6
[FBP-iOS] desc: 2902
[FBP-iOS] desc: 2901
[FBP-iOS] handleMethodCall: setNotifyValue
[FBP-iOS] didUpdateNotificationStateForCharacteristic:
[FBP-iOS] chr: fff6
[FBP-iOS] handleMethodCall: writeCharacteristic
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(writeCharacteristic, The WRITE property is not supported by this BLE characteristic, null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:648:7)
message_codecs.dart:648
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
platform_channel.dart:334
<asynchronous suspension>
#2 FlutterBluePlus._invokeMethod (package:flutter_blue_plus/src/flutter_blue_plus.dart:650:13)
flutter_blue_plus.dart:650
<asynchronous suspension>
#3 BluetoothCharacteristic.write (package:flutter_blue_plus/src/bluetooth_characteristic.dart:222:7)
bluetooth_characteristic.dart:222
<asynchronous suspension>
[FBP-iOS] handleMethodCall: writeDescriptor
*** Assertion failure in -[CBPeripheral writeValue:forDescriptor:], CBPeripheral.m:588
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(iosException, Client Characteristic Configuration descriptors must be configured using setNotifyValue:forCharacteristic:, {stackTrace: 0 CoreFoundation 0x00000001b8a75418 55B9BA28-4C5C-3FE7-9C47-4983337D6E83 + 37912
1 libobjc.A.dylib 0x00000001b1d51c28 objc_exception_throw + 56
2 Foundation 0x00000001b3259810 DCE5E587-2A0D-34CF-8245-23E1B12936A9 + 4601872
3 CoreBluetooth 0x00000001d7ae0ea0 40850243-24A8-3402-9B19-3392D4AF072B + 220832
4 flutter_blue_plus 0x0000000100b74f04 -[FlutterBluePlusPlugin handleMethodCall:result:] + 19120
5 Flutter 0x000000010615e7ac __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 164
6 Flutter 0x0000000105be0570 ___ZN7flutter25PlatformMessageHandlerIos21HandlePlatformMessageENSt3_fl10unique_ptrINS_15PlatformMessageENS1_14default_deleteIS3_EEEE_block_invoke + 116
7 libdispatch.dylib 0x00000001bf81a7a8 B51E7CDB-ABC9-35AF-B8BB-2DCE23BC4D6E + 407464
8 libdispatch.dylib 0x00000001bf81b780 B51E7CDB-ABC9-35AF-B8BB-2DCE23BC4D6E + 411520
9 libdispatch.dylib 0x00000001bf7fce10 B51E7CDB-ABC9-35AF-B8BB-2DCE23BC4D6E + 286224
10 libdispatch.dylib 0x00000001bf7fca88 B51E7CDB-ABC9-35AF-B8BB-2DCE23BC4D6E + 285320
11 CoreFoundation 0x00000001b8afd9ac 55B9BA28-4C5C-3FE7-9C47-4983337D6E83 + 596396
sulamantcig commented
For Future consideration if someone came across this: use
_characteristic.write(command,withoutResponse: true);