summaryrefslogtreecommitdiff
path: root/src/displayapp/DisplayApp.cpp
diff options
context:
space:
mode:
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) {