Closed potto216 closed 5 months ago
@surban are there any changes I should make?
I made some changes to massively simplify your code.
In general you need to look more into existing code to see how things are solved efficiently. For example we use the clap parser, but you tried to introduce the deprecated structopt parser.
Your code looked like it was copied together from snippets generated by ChatGPT oder GitHub copilot. These tools can be useful to get started, but are often wrong, inefficient and do not produce code that is acceptable for production.
@surban before future commits I'll review the code base for more organized, efficient solutions. I tested the code and made some minor modifications. In particular I changed the Manufacture Id numeric format from decimal to hexadecimal to match the Bluetooth "Assigned Numbers" document Section "7.1 Company Identifiers by Value" where the Manufacture Ids are in hexadecimal format.
I believe this is ready for the merge, unless you see other issues.
When --duration
is specified, shouldn't we exit after the specified time, since the advertisement is removed anyway?
Sure, I'll also look if the HCI_LE_Advertising_Set_Terminated event is indicated on the dbus which should be generated when the duration specified in the Duration[i] parameter expires. If not, I'll make the exit based on the duration time plus some padding
I don't see anything in the D-Bus API that would provide a notification when the advertisement is unregistered. I think it is fine to just exit after the specified duration has passed.
Thanks!
Add a command line tool for device advertising. Closes #140