iOS Question Error decoding data as string

D

Deleted member 103

Guest
Hi,

can someone tell me why the function "BytesToString" can not decode the byte "9d"?
Thank you in advance.

ble_01.PNG


ble_02.PNG


Log-File:
Application_Start
InitStarter
AuthorizationChanged: 4
Application_Active
Application_Active
pMain_Appear
pMain_Resize
Base_Resize
Discovering services
Services discovery completed.
Error occurred on line: 159 (clsBluetooth)
Error decoding data as string.
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
Master-Of-Regularity-Lite 0x00000001005f3c9c -[B4ICommon BytesToString::::] + 344
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
Master-Of-Regularity-Lite 0x00000001005ef1ac +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
Master-Of-Regularity-Lite 0x0000000100979d18 -[B4IShell runMethod:] + 448
Master-Of-Regularity-Lite 0x0000000100978890 -[B4IShell raiseEventImpl:method:args::] + 1640
Master-Of-Regularity-Lite 0x000000010097c084 -[B4IShellBI raiseEvent:event:params:] + 1372
Master-Of-Regularity-Lite 0x00000001005e7f64 +[B4IObjectWrapper raiseEvent:::] + 300
Master-Of-Regularity-Lite 0x00000001006a6a68 -[BlePeripheralDel peripheral:didUpdateValueForCharacteristic:error:] + 1276
CoreBluetooth <redacted> + 240
CoreBluetooth <redacted> + 132
CoreBluetooth <redacted> + 356
CoreBluetooth <redacted> + 204
CoreBluetooth <redacted> + 60
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 592
libdispatch.dylib <redacted> + 484
libdispatch.dylib <redacted> + 784
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1964
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 100
UIKitCore UIApplicationMain + 212
Master-Of-Regularity-Lite 0x00000001004df434 main + 124
libdyld.dylib <redacted> + 4
)
 
D

Deleted member 103

Guest
Is the data actually a string encoded with that encoding?
This is the first string I get when connecting to a BLE module (AT-09 !!!Android IOS BLE 4.0 Bluetooth module) from Aliexpress.
For all the others that I have used to date, decoding with "Windows-1252" has worked without any problems.
Now I tried to decode with "iso-8859-1" and it works fine.

Never treat raw bytes as string. Use BytesBuilder instead.
Do you think that's better?
 
Upvote 0
Top