bluez_peripheral icon indicating copy to clipboard operation
bluez_peripheral copied to clipboard

Documentation Updates

Open spacecheese opened this issue 2 years ago • 3 comments

Before release documentation needs updating to reflect the following new features:

  • [x] Defaulting to indefinite timeout (#28)
  • [x] Support for async attribute handlers (#21)
  • [x] The new Release callback (#22)
  • [x] The refactored UUID16 class including new handling of UUID128s (#23)

spacecheese avatar May 19 '23 14:05 spacecheese

The documentation at present seems to have a spelling mistake in the Quickstart section - Advertisment should be Advertisement, as per the code in bluez_peripheral.advert module.

Also in the latest Linux distros (e.g. bookworm) pip installs at the system or user level are discouraged to say the least. Can the module be installed usefully in a virtual environment? There isn't an apt install python3-bluez_peripheral

A more dummy-level example would be useful. For example, what does "# This needs running in an awaitable context." mean? I tried setting up an asyncio async def main structure and it seemed to run, but I couldn't see a dbus service in d-feet, although it's difficult, without dummy guidance, for me to know where to look. The code seemed to ignore the timeout in the third bit code, immediately returning 0 on exit rather than waiting 60 seconds. I also wonder if I need to set up a systemd unit for this to work at all?

drmikecooke avatar Jul 29 '24 11:07 drmikecooke

Hi, Regarding the documentation issues I apologise I haven’t been able to dedicate much time to this project recently. It might be worth cross checking with the rework-docs branch, I think it may not match exactly what is on master but if I remember correctly it has some more examples and the CI has automated spell checking.

I haven’t tested this in a virtual environment but as far as I’m aware it should work the same.

Sorry again my comment is ambiguous I think all I meant here was that this needs to be wrapped in an async function (ie the usual asyncio boilerplate is missing). As far as I remember the dbus service path comes from the register function and I have used d-feet to debug this but I don’t have access to a computer this week so unfortunately I can’t help any further with this. In terms of the timeout issue the advert functionality is non blocking so the function is expected to return immediately- the async calls are only to facilitate communication over dbus. The timeout here would probably be more appropriately called a duration if I remember correctly but this term is borrowed from bluez.

spacecheese avatar Jul 29 '24 15:07 spacecheese

Hi back, thanks for the pointers to the other branches. I've been thrashing around for a week or so, and I am no closer to understanding Bluetooth or the py implementations (development of the basic libraries seemed to stop before py3, about a decade ago, so the example code is aimed at py2). Further, the bt standard seems deliberately designed to be impenetrable. This may be a security thing to stop tinkerers like myself (and hackers) from using it in a simple way.

It is probably best I give up for now.

drmikecooke avatar Jul 30 '24 10:07 drmikecooke