diff options
author | James A. Jerkins <evergreen@jamesjerkinscomputer.com> | 2021-10-30 13:02:39 -0500 |
---|---|---|
committer | JF <JF002@users.noreply.github.com> | 2021-12-09 21:14:16 +0100 |
commit | 62dbcbfc953a36202d96466563a8e71b8bd4ff65 (patch) | |
tree | c4819a9f3716bf6cf4fa839b5116b01671253a6f /src/displayapp/DisplayApp.cpp | |
parent | 85a25302bfac215f9ec7b993f6a2c21a20ee223b (diff) |
Connect and bond with a passkey
This commit adds the following:
Passkey pairing - passkey is displayed on watch
Swipe down to clear passkey screen
Connection encryption
Connection bonding
Automatic reconnects to a bonded peripheral
Trusted device on Android
Note that persisting the bond between reboots is NOT included in
this commit. Therefore, rebooting the watch will cause reconnect failures.
You must delete the bond from the phone to reconnect/pair.
Diffstat (limited to 'src/displayapp/DisplayApp.cpp')
-rw-r--r-- | src/displayapp/DisplayApp.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 80155187..08a76467 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" @@ -288,6 +289,9 @@ void DisplayApp::Refresh() { // Added to remove warning // What should happen here? break; + case Messages::ShowPairingKey: + LoadApp(Apps::PassKey, DisplayApp::FullRefreshDirections::Up); + break; } } @@ -351,6 +355,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); |