Skip to content

Commit

Permalink
Make phone-first the default strategy for now (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
nisargjhaveri authored Jun 7, 2024
1 parent f5965d9 commit ee88171
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions aa_wireless_dongle/board/common/rootfs_overlay/etc/aawgd.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set the connection strategy to use
# 0 - Dongle mode (default). Waits for both dongle and headunit bluetooth connections and then starts the wifi and usb connections.
# 1 - Phone first. Waits for the phone bluetooth and wifi to connect first, and then starts the usb connection.
# 0 - Dongle mode. Waits for both dongle and headunit bluetooth connections and then starts the wifi and usb connections.
# 1 - Phone first (default). Waits for the phone bluetooth and wifi to connect first, and then starts the usb connection.
# 2 - Usb first. Waits for the usb to connect first, and then starts the bluetooth and wifi connection with phone.
AAWG_CONNECTION_STRATEGY=0
AAWG_CONNECTION_STRATEGY=1
7 changes: 5 additions & 2 deletions aa_wireless_dongle/package/aawg/src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,20 @@ WifiInfo Config::getWifiInfo() {

ConnectionStrategy Config::getConnectionStrategy() {
if (!connectionStrategy.has_value()) {
const int32_t connectionStrategyEnv = getenv("AAWG_CONNECTION_STRATEGY", 0);
const int32_t connectionStrategyEnv = getenv("AAWG_CONNECTION_STRATEGY", 1);

switch (connectionStrategyEnv) {
case 0:
connectionStrategy = ConnectionStrategy::DONGLE_MODE;
break;
case 1:
connectionStrategy = ConnectionStrategy::PHONE_FIRST;
break;
case 2:
connectionStrategy = ConnectionStrategy::USB_FIRST;
break;
default:
connectionStrategy = ConnectionStrategy::DONGLE_MODE;
connectionStrategy = ConnectionStrategy::PHONE_FIRST;
break;
}
}
Expand Down

0 comments on commit ee88171

Please sign in to comment.