Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/input/InputBroker.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum input_broker_event {
INPUT_BROKER_ALT_LONG,
INPUT_BROKER_SHUTDOWN = 0x9b,
INPUT_BROKER_GPS_TOGGLE = 0x9e,
INPUT_BROKER_BT_WIFI_TOGGLE = 0x9f,
INPUT_BROKER_SEND_PING = 0xaf,
INPUT_BROKER_MATRIXKEY = 0xFE,
INPUT_BROKER_ANYKEY = 0xff
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ void setup()
mainDelay.interruptFromISR(&higherWake);
};
userConfigNoScreen.singlePress = INPUT_BROKER_USER_PRESS;
userConfigNoScreen.longPress = INPUT_BROKER_NONE;
userConfigNoScreen.longPress = INPUT_BROKER_BT_WIFI_TOGGLE;
userConfigNoScreen.longPressTime = 500;
userConfigNoScreen.longLongPress = INPUT_BROKER_SHUTDOWN;
userConfigNoScreen.doublePress = INPUT_BROKER_SEND_PING;
Expand Down
16 changes: 16 additions & 0 deletions src/modules/SystemCommandsModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ int SystemCommandsModule::handleInputEvent(const InputEvent *event)
}
#endif
return true;
case INPUT_BROKER_BT_WIFI_TOGGLE:
if (config.network.wifi_enabled)
{
LOG_WARN("Disabling WiFi, enabling BT");
config.network.wifi_enabled = false;
config.bluetooth.enabled = true;
}
else
{
LOG_WARN("Enabling WiFi, disabling BT");
config.network.wifi_enabled = true;
config.bluetooth.enabled = false;
}
nodeDB->saveToDisk();
rebootAtMsec = (millis() + DEFAULT_REBOOT_SECONDS * 1000);
return 0;
// Mesh ping
case INPUT_BROKER_SEND_PING:
service->refreshLocalMeshNode();
Expand Down