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

Added tx_power in advertisement_data for Windows, Mac and Linux #987

Merged
merged 13 commits into from
Sep 11, 2022

Conversation

facepolish
Copy link
Contributor

Pull Request Guidelines for Bleak

Before you submit a pull request, check that it meets these guidelines:

  1. If the pull request adds functionality, the docs should be updated.
  2. Modify the CHANGELOG.rst, describing your changes as is specified by the
    guidelines in that document.
  3. The pull request should work for Python 3.7+ on the following platforms:
    • Windows 10, version 16299 (Fall Creators Update) and greater
    • Linux distributions with BlueZ >= 5.43
    • OS X / macOS >= 10.11
  4. Squash all your commits on your PR branch, if the commits are not solving
    different problems and you are committing them in the same PR. In that case,
    consider making several PRs instead.
  5. Feel free to add your name as a contributor to the AUTHORS.rst file!

Copy link
Collaborator

@dlech dlech left a comment

Choose a reason for hiding this comment

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

Thanks! I have made a few suggestions.

bleak/backends/bluezdbus/scanner.py Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated
@@ -19,6 +19,8 @@ Changed
* The BlueZ D-Bus backend implements a services cache between connections to significancy improve reconnect performance.
To use the cache, call ``connect`` and ``get_services`` with the ``dangerous_use_bleak_cache``
argument to avoid services being resolved again.
* ``AdvertisementData`` class now has an attribute ``tx_power``. scanner.py in backends of winrt, corebluetooth and
bluezdbus were changed to set tx_power if available.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we get this for the Android backend too (even if you aren't able to test it)?

i.e. use result.getTxPower() in _PythonScanCallback.onScanResult().

It also looks like we might want to convert ScanResult.TX_POWER_NOT_PRESENT to None to be consistent with other backends.

https://developer.android.com/reference/android/bluetooth/le/ScanResult#getTxPower()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Actually now I have Android Studio but don't have test environment Android (will come in 2 weeks). So this time I made changes and test them later (if necessary). Thank you for your advice.

bleak/backends/corebluetooth/scanner.py Outdated Show resolved Hide resolved
bleak/backends/scanner.py Outdated Show resolved Hide resolved
facepolish and others added 6 commits September 9, 2022 22:55
@dlech dlech merged commit e5304e1 into hbldh:develop Sep 11, 2022
@dlech
Copy link
Collaborator

dlech commented Sep 11, 2022

Merged, thanks!

@dlech dlech mentioned this pull request Sep 12, 2022
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.

None yet

2 participants