OpenBluetoothToolbox / SimpleBLE

SimpleBLE - the all-in-one Bluetooth library for MacOS, iOS, Windows, Linux and Android.
https://www.simpleble.org
Other
619 stars 107 forks source link

SimpleBLE v0.6.1 - MacOS writeCommand Failing #294

Closed L4m4L closed 1 month ago

L4m4L commented 4 months ago

Hello,

I am trying to integrate a Java macOS BLE library (https://github.com/youxingz/javablex) into a plugin I am writing. I believe this library uses SimpleBLE version 0.6.1 or earlier to provide the native interface to Java.

I can successfully discover and connect to peripherals using this library, however if I try to write to a characteristic (using the writeCommand or writeRequest functions), the program crashes with the error:

libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc

I think this error is originating from the SimpleBLE side, rather than "javablex", as far as I can tell I am passing all the arguments correctly to the Java library and am sending valid data across to my device.

I was just wondering if anyone else has had similar issues writing data using the SimpleBLE plugin on macOS and if there is anything I could try to resolve this?

Appreciate any advice that could be given. Thanks!!

kdewald commented 1 month ago

Lots has changed since v0.6.1, so I can't answer if other libraries are having issues with older versions.

We have an official Java version of SimpleBLE in the works, but we're still a few months out.