Merge ~sylvain-pineau/checkbox-support:eddystone_scanner_poweron_bluetoothctl into checkbox-support:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 6c543b130bbdb261fb579327e363aeb9c4a16361
Merged at revision: 9a352e7482b26ca734bcea826ae822792b02677d
Proposed branch: ~sylvain-pineau/checkbox-support:eddystone_scanner_poweron_bluetoothctl
Merge into: checkbox-support:master
Diff against target: 26 lines (+7/-0)
1 file modified
checkbox_support/scripts/eddystone_scanner.py (+7/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+356422@code.launchpad.net

Description of the change

power on the BT adapter using bluetoothctl as we can face the following bug on UC:

https://bugs.launchpad.net/snappy-hwe-snaps/+bug/1706649

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/checkbox_support/scripts/eddystone_scanner.py b/checkbox_support/scripts/eddystone_scanner.py
2index 62f6cc0..c67626e 100644
3--- a/checkbox_support/scripts/eddystone_scanner.py
4+++ b/checkbox_support/scripts/eddystone_scanner.py
5@@ -22,7 +22,9 @@ import argparse
6 import asyncio
7 import logging
8 import sys
9+import time
10
11+from checkbox_support.interactive_cmd import InteractiveCommand
12 from checkbox_support.vendor.aioblescan import create_bt_socket
13 from checkbox_support.vendor.aioblescan import BLEScanRequester
14 from checkbox_support.vendor.aioblescan import HCI_Cmd_LE_Advertise
15@@ -64,6 +66,11 @@ def main():
16 except Exception as e:
17 parser.error("Error: " + str(e))
18 return 1
19+ with InteractiveCommand('bluetoothctl') as btctl:
20+ btctl.writeline('power on')
21+ time.sleep(1)
22+ btctl.writeline('exit')
23+ btctl.kill()
24 event_loop = asyncio.get_event_loop()
25 # First create and configure a STREAM socket
26 try:

Subscribers

People subscribed via source and target branches