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

Java bindings #265

Open
KlemenDEV opened this issue Oct 9, 2023 · 8 comments
Open

Java bindings #265

KlemenDEV opened this issue Oct 9, 2023 · 8 comments

Comments

@KlemenDEV
Copy link

It would be neat to have Java bindings for this library. There is currently no BLE desktop Java library to my knowledge.

JNA/SWIG/JNR-FFI could be used to achieve this.

Originally this was a comment at #121 but moved to a separate ticket.

@KlemenDEV
Copy link
Author

I have started to work on Java bindings, but am currently stuck at #267

@enkatsu
Copy link

enkatsu commented Jan 7, 2024

@KlemenDEV Just like you, I am also developing Java bindings.
If you don’t mind, I would like to contribute to your development work. Could you please share with me the URL of your repository?

@lebenski
Copy link

I would love this! Any work in progress that I can take a look at?

@L4m4L
Copy link

L4m4L commented Mar 5, 2024

@KlemenDEV how did you go with Java bindings? I have made good progress, but am currently stuck on passing my user-defined structs to the simpleble_peripheral_write_command function. Any assistance would be appreciated!

@KlemenDEV
Copy link
Author

The project got a bit stuck because it is currently not the priority at the company I was working on those bindings for

@L4m4L
Copy link

L4m4L commented Mar 5, 2024

No worries, I will post up my repo so others can critique it - it's close I think but I'm not implementing the Pointers correctly I think with JNI-FFI (for function calls using structs)

@L4m4L
Copy link

L4m4L commented Mar 5, 2024

Here's where I have gotten up to, very messy at the moment but not sure if it is similar to where you left off?

If I can get something to work I will definitely update this code and share it with SimpleBLE

@L4m4L
Copy link

L4m4L commented Apr 1, 2024

Hi @KlemenDEV, I finally got Java bindings to work using Java Native Access. The weirdest thing was that I needed to change the parameter order for "simpleble_peripheral_write_command" in order for it to work...? So I think JNA was mixing up calling conventions somewhere along the way, so it may not be that stable.

Anyway, the code is here. Happy for questions/comments/feedback!

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

4 participants