Skip to content

Commit

Permalink
in single bt mode, without bluetooth restart, subsequent BLE re-conne…
Browse files Browse the repository at this point in the history
…ctions failed.

so in only case of single bt mode, add a function to restart Bluetooth between BLE reconnections.

Signed-off-by: dooho88.lee <[email protected]>
  • Loading branch information
dooho-lee committed Jul 25, 2023
1 parent bd56bc5 commit 0f5bfc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/process_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from common.utils import Utils
from common.config import Config

import signal
import signal, os, time
from psutil import *
from subprocess import *

Expand Down Expand Up @@ -75,6 +75,8 @@ def launch_chip_all_clusters(self, device_info):
device_info.thread_type, device_info.com_port,
device_info.debug_level, device_info.device_num,
device_info.vid, device_info.pid)
os.system('sudo service bluetooth restart')
time.sleep(1)
else:
run_param = ProcessController.RUN_PARAM_CHIP_ALL_CLUSTERS_FORMAT_WITH_MULTI_BLE % (
device_info.device_id, device_info.discriminator,
Expand All @@ -94,6 +96,7 @@ def launch_chip_all_clusters(self, device_info):
device_type = "fed"

path = Utils.get_script_path() + 'start'

self.subProcess = Popen([path, run_param, device_type])
self.set_pid(self.subProcess.pid)
return self.pid
Expand Down

0 comments on commit 0f5bfc0

Please sign in to comment.