JuulLabs / kable

Kotlin Asynchronous Bluetooth Low-Energy
https://juullabs.github.io/kable
Apache License 2.0
850 stars 84 forks source link

Support Linux / Windows JVM targets #380

Open danielgruber opened 2 years ago

danielgruber commented 2 years ago

Currently, the Kable Library does not support Windows or Linux targets.

There are libraries like https://github.com/weliem/blessed-bluez, that support Windows or Linux. It would be great to investigate if this could be an approach for kable to extend the platform compatibility. I really like the APIs from Kable, so I would prefer using such a library for all platforms instead of using different ones.

saket commented 2 years ago

Same request for macOS!

twyatt commented 2 years ago

Same request for macOS!

@saket MacOS is already supported. 🙂

saket commented 2 years ago

I'm sorry, I meant support for macOS through JVM

twyatt commented 1 year ago

I've done some initial investigation into this. DBus seems to be the standard approach to communicating with Bluez on JVM (it is what Blessed Bluez library, that was linked, is doing).

Unfortunately, my development machine is a Macbook, and macOS doesn't have DBus out-of-the-box — it can be set up, but it seemed like a bigger lift than I have time to take on right now.

I might try to get a hold of a Raspberry Pi (with BLE) for testing, but ideally I may look into getting an affordable Linux box for developing this feature.

All that is to say: I am interested in moving the needle on this one, but it will likely be a long ways out.

donadev commented 1 year ago

Good morning, any update on this? :) I've been using this library for a while, and I would love to be able to use it in the JVM as well!

twyatt commented 1 year ago

Unfortunately, no new movement yet. I've been swamped with other projects and haven't yet invested in a machine that I can install Linux on (for developing this feature).

I am very interested in adding support for this, but I imagine it will be a couple months before I can focus on this again. 😢

konpach commented 10 months ago

Any update here? Could a first step be to provide void implementation(throws e.g. some runtime exception) so it's possible to compile this for jvm along with other targets (iOS, android). Otherwise we need to wrap BLE interface in expect and provide kable as an actual implementation in the available targets.

twyatt commented 9 months ago

I like that idea, unfortunately I'm swamped with other work projects at the moment.

konpach commented 9 months ago

I have a PR for you to add this! How to contribute?

konpach commented 9 months ago

@twyatt if the project is not open for contribution I am happy to send/upload the code change and you can review and add it to the project. I am talking about adding a void jvm implementation as proposed above.

twyatt commented 9 months ago

Kable is definitely open to contribution, it is under the Apache 2 licence with numerous contributors.

Create a PR and project maintainers will review it.

konpach commented 9 months ago
Screenshot 2024-01-30 at 18 56 45 Screenshot 2024-01-30 at 18 56 58

@twyatt Creating a PR right away is not possible, only if I fork and propose. Maybe I'm getting something wrong though.

twyatt commented 9 months ago

Yes, please fork. You can push your existing branch (add-jvm-target-with-void-implem) to your fork, then create a PR. The head repository will be your fork and branch, and the base repository would be JuulLabs/kable with base: main.

cedrickcooke commented 9 months ago

Might be possible to implement with JNI bindings to this: https://github.com/OpenBluetoothToolbox/SimpleBLE

cedrickcooke commented 6 months ago

Looks like they changed their license so we can't use this without reaching out, but they have exceptions for other open-source BLE libraries like https://github.com/thegecko/webbluetooth, so it might still be possible.

twyatt commented 5 months ago

I sent an email to SimpleBLE on Jun 6, 2024, I'll post updates on this issue if I hear back.