File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ enum input_broker_event {
1818 INPUT_BROKER_ALT_LONG,
1919 INPUT_BROKER_SHUTDOWN = 0x9b ,
2020 INPUT_BROKER_GPS_TOGGLE = 0x9e ,
21+ INPUT_BROKER_BT_WIFI_TOGGLE = 0x9f ,
2122 INPUT_BROKER_SEND_PING = 0xaf ,
2223 INPUT_BROKER_MATRIXKEY = 0xFE ,
2324 INPUT_BROKER_ANYKEY = 0xff
Original file line number Diff line number Diff line change @@ -1123,7 +1123,7 @@ void setup()
11231123 mainDelay.interruptFromISR (&higherWake);
11241124 };
11251125 userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS;
1126- userConfigNoScreen.longPress = INPUT_BROKER_NONE ;
1126+ userConfigNoScreen.longPress = INPUT_BROKER_BT_WIFI_TOGGLE ;
11271127 userConfigNoScreen.longPressTime = 500 ;
11281128 userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN;
11291129 userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING;
Original file line number Diff line number Diff line change @@ -101,6 +101,22 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event)
101101 }
102102#endif
103103 return true ;
104+ case INPUT_BROKER_BT_WIFI_TOGGLE:
105+ if (config.network .wifi_enabled )
106+ {
107+ LOG_WARN (" Disabling WiFi, enabling BT" );
108+ config.network .wifi_enabled = false ;
109+ config.bluetooth .enabled = true ;
110+ }
111+ else
112+ {
113+ LOG_WARN (" Enabling WiFi, disabling BT" );
114+ config.network .wifi_enabled = true ;
115+ config.bluetooth .enabled = false ;
116+ }
117+ nodeDB->saveToDisk ();
118+ rebootAtMsec = (millis () + DEFAULT_REBOOT_SECONDS * 1000 );
119+ return 0 ;
104120 // Mesh ping
105121 case INPUT_BROKER_SEND_PING:
106122 service->refreshLocalMeshNode ();
You can’t perform that action at this time.
0 commit comments