summaryrefslogtreecommitdiff
path: root/src/systemtask/SystemTask.cpp
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-10 11:00:50 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-10 11:19:45 (GMT)
commit4f46da35b4a1b0a708594cb91343b921928d6a01 (patch)
tree91d20252a8ff11648f9449cebaa29702ce0a6438 /src/systemtask/SystemTask.cpp
parent9f68f5b227ad3c83130d7cc521c80b6caf974466 (diff)
Bluetooth Passkey Toggle setting
Diffstat (limited to 'src/systemtask/SystemTask.cpp')
-rw-r--r--src/systemtask/SystemTask.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp
index 20ff937..4d803cd 100644
--- a/src/systemtask/SystemTask.cpp
+++ b/src/systemtask/SystemTask.cpp
@@ -134,7 +134,14 @@ void SystemTask::Work() {
fs.Init();
+ settingsController.Init();
+ if(settingsController.GetBluetoothPasskeyEnabled()) {
+ bleController.EnablePasskey();
+ } else {
+ bleController.DisablePasskey();
+ }
nimbleController.Init();
+
lcd.Init();
twiMaster.Init();
@@ -161,7 +168,6 @@ void SystemTask::Work() {
motionSensor.Init();
motionController.Init(motionSensor.DeviceType());
- settingsController.Init();
displayApp.Register(this);
displayApp.Start(bootError);
@@ -447,6 +453,13 @@ void SystemTask::Work() {
nimbleController.DisableRadio();
}
break;
+ case Messages::BluetoothPasskeyEnableToggle:
+ if(settingsController.GetBluetoothPasskeyEnabled()) {
+ bleController.EnablePasskey();
+ } else {
+ bleController.DisablePasskey();
+ }
+ break;
default:
break;
}