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

Add a command line tool for device advertising #140 #143

Merged
merged 9 commits into from
Jun 13, 2024
Merged

Add a command line tool for device advertising #140 #143

merged 9 commits into from
Jun 13, 2024

Conversation

potto216
Copy link
Contributor

Add a command line tool for device advertising. Closes #140

@potto216
Copy link
Contributor Author

potto216 commented Jun 6, 2024

@surban are there any changes I should make?

@surban
Copy link
Collaborator

surban commented Jun 7, 2024

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.

@potto216
Copy link
Contributor Author

potto216 commented Jun 8, 2024

@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.

@surban
Copy link
Collaborator

surban commented Jun 10, 2024

When --duration is specified, shouldn't we exit after the specified time, since the advertisement is removed anyway?

@potto216
Copy link
Contributor Author

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

@surban
Copy link
Collaborator

surban commented Jun 11, 2024

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.

@surban surban merged commit 8cbc669 into bluez:master Jun 13, 2024
2 checks passed
@surban
Copy link
Collaborator

surban commented Jun 13, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

Add a command line tool for device advertising
2 participants