summaryrefslogtreecommitdiff
path: root/src/displayapp/DisplayApp.cpp
diff options
context:
space:
mode:
authorKieran Cawthray <kieranc@gmail.com>2021-12-09 22:41:29 +0100
committerKieran Cawthray <kieranc@gmail.com>2021-12-09 22:41:29 +0100
commit6cf4a933b6323fc24a3b27ae55a3c12d31d6a841 (patch)
treeffee2e59a62efe62aa8255f68e7cc89be1cad152 /src/displayapp/DisplayApp.cpp
parentae4b9e0f2e877d200bd780f99e2a8952f9f8bf5b (diff)
parent42a5cdb5b776c2cdeb08a8c6f26606282a809178 (diff)
Merge remote-tracking branch 'upstream/develop' into pts-settings
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
-rw-r--r--src/displayapp/DisplayApp.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp
index 1819eed9..ff70363a 100644
--- a/src/displayapp/DisplayApp.cpp
+++ b/src/displayapp/DisplayApp.cpp
@@ -29,6 +29,7 @@
#include "displayapp/screens/FlashLight.h"
#include "displayapp/screens/BatteryInfo.h"
#include "displayapp/screens/Steps.h"
+#include "displayapp/screens/PassKey.h"
#include "displayapp/screens/Error.h"
#include "drivers/Cst816s.h"
@@ -213,6 +214,9 @@ void DisplayApp::Refresh() {
} else {
LoadApp(Apps::Alarm, DisplayApp::FullRefreshDirections::None);
}
+ case Messages::ShowPairingKey:
+ LoadApp(Apps::PassKey, DisplayApp::FullRefreshDirections::Up);
+ break;
case Messages::TouchEvent: {
if (state != States::Running) {
break;
@@ -350,6 +354,11 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::None);
break;
+ case Apps::PassKey:
+ currentScreen = std::make_unique<Screens::PassKey>(this, bleController.GetPairingKey());
+ ReturnApp(Apps::Clock, FullRefreshDirections::Down, TouchEvents::SwipeDown);
+ break;
+
case Apps::Notifications:
currentScreen = std::make_unique<Screens::Notifications>(
this, notificationManager, systemTask->nimble().alertService(), motorController, Screens::Notifications::Modes::Normal);
@@ -492,8 +501,9 @@ void DisplayApp::SetFullRefresh(DisplayApp::FullRefreshDirections direction) {
}
void DisplayApp::PushMessageToSystemTask(Pinetime::System::Messages message) {
- if (systemTask != nullptr)
+ if (systemTask != nullptr) {
systemTask->PushMessage(message);
+ }
}
void DisplayApp::Register(Pinetime::System::SystemTask* systemTask) {