Git Product home page Git Product logo

Comments (16)

Packetdancer avatar Packetdancer commented on June 27, 2024 1

While the baseline is in place, there are several limitations:

  1. There doesn't seem to be an easy way to actually include service UUIDs in the advertisement packet.
  2. There doesn't seem to be an easy way to actually override the ReadValue/WriteValue behavior in order to provide values.
  3. The notification behavior doesn't presently work.

If these three points are addressed, the service mode should work properly.

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024 1

I also discovered that including the entire advertisement packet doesn't always advertise correctly if not everything was filled out; including just Type, ServiceUUIDs, and LocalName worked properly.

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Based on your PR I would say that 2 is done. Do you have any suggestion on the other points ?

  1. Maybe can be enabled via an hci command or related to #25?
  2. Will check it, probably a communication issue on go-bluetooth side..

Thanks!

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

2 and 3 are done in the PR, actually; if you use UpdateValue it properly does notification now.

1 can be fixed by #25, yes; adding the UUIDs to ServiceUUIDs would do the trick.

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Will see to work on #25 soon to close that issue, if you are interested in working on that let me know

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

I do actually need it for a project, but I'm stuck in client meetings right now; if you haven't gotten to it later this week I might take a stab at it.

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

For what it's worth, I managed to get advertisement working entirely over dbus (no need to use the btmgmt command), but I'm not 100% happy with the API I put together while testing; I don't quite think it fits with the rest of the existing API properly.

I can throw what I have your way to look at later if you'd like, though.

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Yup yup, cross posting here 🥇

Please share, I have no particular need to keep that API approach and can eventually forsee a v2

In the meanwhile, I added an inital implementation and next step is probably to be bind at the service initialization

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

Awesome! My implementation had it as part of Application; when you initialized a service I had a new 'Advertised' field in the config struct, and then Application had a StartAdvertising where it would build an LEAdvertisement1 based on the app.config.name (for LocalName) and what services were flagged as Advertised, and register the advertisement.

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Great, let me check the implementation. Mine is in https://github.com/muka/go-bluetooth/tree/dev

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

Mine's in https://github.com/packetdancer/go-bluetooth/tree/service-advertisement — feel free to grab whatever helps from there. :)

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

Only caveat in mine is that after you've called StartAdvertising on the application, you want to grab an Adapter1 and set the Discoverable and Powered properties to true.

The Application implementation of StartAdvertising also needs the Call functionality pulled over into api.* most likely, if my approach was followed.

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Your code looks good to me, would you like to PR?

Thanks!

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

Let me pull in your implementation and add my features atop it, I think your inclusion of LEAdvertisementManager is a better design in keeping with the framework.

from go-bluetooth.

Packetdancer avatar Packetdancer commented on June 27, 2024

Pull request in!

from go-bluetooth.

muka avatar muka commented on June 27, 2024

Merged, kudos to @Packetdancer for the great contribution!

Closing #7 and #25. Let's open new ones in case of bugs or further features request

from go-bluetooth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.