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

feat: reduce overhead to find a response #18

Merged
merged 1 commit into from
Nov 16, 2022
Merged

feat: reduce overhead to find a response #18

merged 1 commit into from
Nov 16, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Nov 16, 2022

We now avoid parsing data when we are not waiting
for a response

When we first connect we aren't looking for a response
but if a scan is running we start drinking from the firehouse
right away. We want to avoid decoding all those frames
until we are actually waiting for a response.

closes #16

We now avoid parsing data when we are not waiting
for a response

closes #16
@codecov
Copy link

codecov bot commented Nov 16, 2022

Codecov Report

Base: 18.40% // Head: 18.50% // Increases project coverage by +0.09% 🎉

Coverage data is based on head (d831c57) compared to base (9d2aa1a).
Patch coverage: 50.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #18      +/-   ##
==========================================
+ Coverage   18.40%   18.50%   +0.09%     
==========================================
  Files           2        2              
  Lines         201      200       -1     
  Branches       32       32              
==========================================
  Hits           37       37              
+ Misses        163      162       -1     
  Partials        1        1              
Impacted Files Coverage Δ
src/bluetooth_auto_recovery/recover.py 17.25% <0.00%> (+0.08%) ⬆️
src/bluetooth_auto_recovery/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@bdraco
Copy link
Member Author

bdraco commented Nov 16, 2022

testing looks good

2022-11-16 03:09:40,505 - btsocket.btmgmt_protocol - DEBUG - Socket Read: <event_code=CommandCompleteEvent, controller_idx=0, param_len=283> <command_opcode=ReadControllerInformation, status=Success> <address=00:E0:4C:2A:25:63, bluetooth_version=10, manufacturer=93, supported_settings=245503, current_settings={Powered: True, Connectable: False, FastConnectable: False, Discoverable: False, Bondable: False, LinkLevelSecurity: False, SecureSimplePairing: True, BREDR: True, HighSpeed: False, LowEnergy: True, Advertising: False, SecureConnections: True, DebugKeys: False, Privacy: False, ControllerConfiguration: False, StaticAddress: False, PHYConfiguration: False, WidebandSpeech: False}, class_of_device=2883584, name=b'BlueZ 5.63', short_name=0>
DEBUG:btsocket.btmgmt_protocol:Socket Read: <event_code=CommandCompleteEvent, controller_idx=0, param_len=283> <command_opcode=ReadControllerInformation, status=Success> <address=00:E0:4C:2A:25:63, bluetooth_version=10, manufacturer=93, supported_settings=245503, current_settings={Powered: True, Connectable: False, FastConnectable: False, Discoverable: False, Bondable: False, LinkLevelSecurity: False, SecureSimplePairing: True, BREDR: True, HighSpeed: False, LowEnergy: True, Advertising: False, SecureConnections: True, DebugKeys: False, Privacy: False, ControllerConfiguration: False, StaticAddress: False, PHYConfiguration: False, WidebandSpeech: False}, class_of_device=2883584, name=b'BlueZ 5.63', short_name=0>
DEBUG:bluetooth_auto_recovery.recover:Power state of bluetooth adapter hci0 is ON after power cycle

@bdraco bdraco marked this pull request as ready for review November 16, 2022 13:10
@bdraco bdraco merged commit 219d3f7 into main Nov 16, 2022
@bdraco bdraco deleted the reorder branch November 16, 2022 13:10
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.

Don’t decode the packet unless the future is not None or not done
1 participant