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 @@ -20,6 +20,7 @@ enum input_broker_event {
2020 INPUT_BROKER_ALT_LONG,
2121 INPUT_BROKER_SHUTDOWN = 0x9b ,
2222 INPUT_BROKER_GPS_TOGGLE = 0x9e ,
23+ INPUT_BROKER_BT_WIFI_TOGGLE = 0x9f ,
2324 INPUT_BROKER_SEND_PING = 0xaf ,
2425 INPUT_BROKER_MATRIXKEY = 0xFE ,
2526 INPUT_BROKER_ANYKEY = 0xff
Original file line number Diff line number Diff line change @@ -1116,7 +1116,7 @@ void setup()
11161116 mainDelay.interruptFromISR (&higherWake);
11171117 };
11181118 userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS;
1119- userConfigNoScreen.longPress = INPUT_BROKER_NONE ;
1119+ userConfigNoScreen.longPress = INPUT_BROKER_BT_WIFI_TOGGLE ;
11201120 userConfigNoScreen.longPressTime = 500 ;
11211121 userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN;
11221122 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