iOS Question BLE Set Notify Problem

tzfpg

Active Member
Licensed User
Longtime User
When BLE connected, i set manager.setnotify, i got an error.

B4X:
Sub Manager_Connected (services As List)
    Log("Connected")
    connected = True
    ConnectedServices = services
    StateChanged
    manager.ReadData(serviceId)
    manager.SetNotify(serviceId, charId, True)
End Sub

Error Description:
B4X:
Copying updated assets files (1)
Application_Start
Application_Active
Found: B4X, 7885B0FB-6ABB-6E89-39B8-FA74D346F614, RSSI = -55, (read only map) {
    kCBAdvDataIsConnectable = 1;
    kCBAdvDataLocalName = B4X;
    kCBAdvDataTxPowerLevel = 3;
}
Discovering services
Services discovery completed.
Connected
Error occurred on line: 150 (Main)
Service not found
Stack Trace: (
  CoreFoundation       <redacted> + 252
  libobjc.A.dylib      objc_exception_throw + 56
  CoreFoundation       <redacted> + 0
  B4i Example          -[BleManager getService:] + 612
  B4i Example          -[BleManager ReadData:] + 176
  B4i Example          -[b4i_main _manager_connected:] + 904
  CoreFoundation       <redacted> + 144
  CoreFoundation       <redacted> + 292
  B4i Example          +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
  B4i Example          -[B4IShell runMethod:] + 448
 B4i Example          -[B4IShell raiseEventImpl:method:args::] + 1648
 B4i Example          -[B4IShellBI raiseEvent:event:params:] + 1580
 B4i Example          +[B4IObjectWrapper raiseEvent:::] + 300
 B4i Example          -[BlePeripheralDel peripheral:didDiscoverServices:] + 708
 CoreBluetooth        <redacted> + 932
 CoreBluetooth        <redacted> + 352
 CoreBluetooth        <redacted> + 204
 CoreBluetooth        <redacted> + 60
 libdispatch.dylib    <redacted> + 24
 libdispatch.dylib    <redacted> + 16
 libdispatch.dylib    <redacted> + 592
 libdispatch.dylib    <redacted> + 480
 libdispatch.dylib    <redacted> + 784
 CoreFoundation       <redacted> + 12
 CoreFoundation       <redacted> + 1924
 CoreFoundation       CFRunLoopRunSpecific + 436
 GraphicsServices     GSEventRunModal + 104
 UIKitCore            UIApplicationMain + 212
 B4i Example          main + 124
 libdyld.dylib        <redacted> + 4
)

i upload small project, please help me check see where i miss.

Thank you
 

Attachments

  • BLE.zip
    9.7 KB · Views: 239
Top