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

Improve Broadcast Scanning #591

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Improve Broadcast Scanning #591

merged 1 commit into from
Nov 15, 2024

Conversation

zxzxwu
Copy link
Collaborator

@zxzxwu zxzxwu commented Nov 15, 2024

  • APP: Allow scanning for broadcast without name (check annoucement instead)
  • Add BAP dataclass serializer
  • Allow nullable codec specific configuration fields
  • Remove BAP CodecID (use HCI CodecID/Format instead, though the term is a little bit confusing)

@zxzxwu
Copy link
Collaborator Author

zxzxwu commented Nov 15, 2024

I use 3.10 typing annotations - with __annotations__, Python doesn't parse these annotations in runtime, and mypy works well with them in 3.9.

apps/auracast.py Outdated

broadcast_name = (
advertisement.data.get(bumble.core.AdvertisingData.BROADCAST_NAME)
or 'Unknown'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a (small) risk of conflict here. If a real broadcast service uses the name 'Unknown', we don't know the difference. Maybe the best would be to allow passing None for the broadcast_name parameter of self.on_new_broadcast?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Skip name when it's None here.

@zxzxwu zxzxwu merged commit 5e959d6 into google:main Nov 15, 2024
57 checks passed
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.

2 participants