Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS write characteristic exception #11

Open
pbaker5 opened this issue Aug 14, 2019 · 2 comments
Open

iOS write characteristic exception #11

pbaker5 opened this issue Aug 14, 2019 · 2 comments

Comments

@pbaker5
Copy link

pbaker5 commented Aug 14, 2019

On iOS, I able to successfully connect to a BLE device, but when I attempt to write to a characteristic I get the following exception. It works fine on Android. Any ideas?

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: BleException: The operation couldn’t be completed. (rx_ble.Errors error 1.)
0 plugin_scaffold 0x0000000100973e50 $s15plugin_scaffold14serializeErrorySo07FlutterD0CypF + 316
1 plugin_scaffold 0x0000000100975098 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctFyycfU_ + 312
2 plugin_scaffold 0x00000001009751d0 $sIeg_IeyB_TR + 52
3 plugin_scaffold 0x00000001009735d0 +[PluginScaffoldHelper tryCatch:onCatch:onElse:] + 108
4 plugin_scaffold 0x0000000100974f38 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctF + 624
5 plugin_scaffold 0x0000000100977828 $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_yycfU_ + 4204
6 plugin_scaffold 0x0000000100974fd0 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctFyycfU_ + 112
7 plugin_scaffold 0x00000001009751d0 $sIeg_IeyB_TR + 52
8 plugin_scaffold 0x00000001009735d0 +[PluginScaffoldHelper tryCatch:onCatch:onElse:] + 108
9 plugin_scaffold 0x0000000100974f38 $s15plugin_scaffold11catchErrorsyyyypSgc_yyKctF + 624
10 plugin_scaffold 0x0000000100976730 $s15plugin_scaffold20createPluginScaffold9messenger11channelName9methodMapSo20FlutterMethodChannelCSo0K15BinaryMessenger_p_SSSDySSypGtFySo0kL4CallC_yypSgctcfU_ + 436
11 plugin_scaffold 0x000000010097a88c $sSo17FlutterMethodCallCypSgIegn_Ieggg_AByXlSgIeyBy_IeyByy_TR + 168
12 Flutter 0x0000000100adf2e8 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 128
13 Flutter 0x0000000100a79f78 _ZNK7flutter21PlatformMessageRouter21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 224
14 Flutter 0x0000000100a7e098 _ZN7flutter15PlatformViewIOS21HandlePlatformMessageEN3fml6RefPtrINS_15PlatformMessageEEE + 40
15 Flutter 0x0000000100ad9d4c _ZNSt3__110__function6__funcIZN7flutter5Shell29OnEngineHandlePlatformMessageEN3fml6RefPtrINS2_15PlatformMessageEEEE4$_27NS_9allocatorIS8_EEFvvEEclEv + 80
16 Flutter 0x0000000100a8b7c4 _ZN3fml15MessageLoopImpl10FlushTasksENS_9FlushTypeE + 116
17 Flutter 0x0000000100a901bc ZN3fml17MessageLoopDarwin11OnTimerFireEP16__CFRunLoopTimerPS0 + 32
18 CoreFoundation 0x00000001afdfa650 + 28
19 CoreFoundation 0x00000001afdfa380 + 864
20 CoreFoundation 0x00000001afdf9bb4 + 248
21 CoreFoundation 0x00000001afdf4b04 + 1844
22 CoreFoundation 0x00000001afdf40b0 CFRunLoopRunSpecific + 436
23 GraphicsServices 0x00000001b1ff479c GSEventRunModal + 104
24 UIKitCore 0x00000001dc39e978 UIApplicationMain + 212
25 Runner 0x000000010043bad4 main + 124
26 libdyld.dylib 0x00000001af8b98e0 + 4
#0 rethrowException
package:rx_ble/src/exception_serializer.dart:17
#1 RxBle.observeChar.
package:rx_ble/rx_ble.dart:260
#2 _invokeErrorHandler (dart:async/async_error.dart:17:29)
#3 _HandleErrorStream._handleError (dart:async/stream_pipe.dart:286:9)
#4 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13)
#5 _rootRunBinary (dart:async/zone.dart:1144:38)
#6 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#7 _CustomZone.runBinaryGuarded (dart:async/zone.dart:939:7)
#8 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15)
#9 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16)
#10 _BufferingStreamSubscription._addError (dart:async/stream_impl.dart:272:7)
#11 _ForwardingStreamSubscription._addError (dart:async/stream_pipe.dart:137:11)
#12 _ForwardingStream._handleError (dart:async/stream_pipe.dart:102:10)
#13 _ForwardingStreamSubscription._handleError (dart:async/stream_pipe.dart:168:13)
#14 _rootRunBinary (dart:async/zone.dart:1144:38)
#15 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#16 _CustomZone.runBinaryGuarded (dart:async/zone.dart:939:7)
#17 _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:355:15)
#18 _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:373:16)
#19 _DelayedError.perform (dart:async/stream_impl.dart:602:14)
#20 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:707:11)
#21 _PendingEvents.schedule. (dart:async/stream_impl.dart:667:7)
#22 _rootRun (dart:async/zone.dart:1120:38)
#23 _CustomZone.run (dart:async/zone.dart:1021:19)
#24 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#25 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
#26 _rootRun (dart:async/zone.dart:1124:13)
#27 _CustomZone.run (dart:async/zone.dart:1021:19)
#28 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#29 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:963:23)
#30 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#31 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)

flutter doctor -v
[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.6 18G87, locale en-AU)
• Flutter version 1.7.8+hotfix.4 at /Users//Downloads/flutter
• Framework revision 20e59316b8 (4 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users//Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.7.4

[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4

[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 35.3.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.37.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.3.0

[✓] Connected device (2 available)
• ’s iPad • 1949212cb39e1990bf4c654032f5e040b755efec • ios • iOS 12.3
• iPhone Xʀ • 99F72161-60A4-463B-8C03-901C15C46500 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)

• No issues found!

@mengzhidaren
Copy link

writeChar to be change
sendSingle(peripheral.writeValue(value.data, for: char, type: .withoutResponse, canSendWriteWithoutResponseCheckEnabled: false), result) {
FlutterStandardTypedData(bytes: $0.value ?? Data())
}

to change withoutResponse not withResponse

@pbaker5
Copy link
Author

pbaker5 commented Aug 20, 2019

@mengzhidaren thanks for the suggestion. I forked, made that change, but I got the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants