Add support for BLE notification (ANS client).

Work In Progress!!!
This commit is contained in:
JF
2020-03-25 21:23:40 +01:00
parent 7e9a7e4d5f
commit 68240704c7
13 changed files with 346 additions and 12 deletions
+11
View File
@@ -38,6 +38,7 @@ DisplayApp::DisplayApp(Pinetime::Drivers::St7789& lcd,
systemTask{systemTask} {
msgQueue = xQueueCreate(queueSize, itemSize);
onClockApp = true;
modal.reset(new Screens::Modal(this));
}
void DisplayApp::Start() {
@@ -103,6 +104,7 @@ void DisplayApp::Refresh() {
state = States::Running;
break;
case Messages::UpdateDateTime:
// modal->Show();
break;
case Messages::UpdateBleConnection:
// clockScreen.SetBleConnectionState(bleController.IsConnected() ? Screens::Clock::BleConnectionStates::Connected : Screens::Clock::BleConnectionStates::NotConnected);
@@ -110,6 +112,15 @@ void DisplayApp::Refresh() {
case Messages::UpdateBatteryLevel:
// clockScreen.SetBatteryPercentRemaining(batteryController.PercentRemaining());
break;
case Messages::NewNotification: {
Pinetime::Controllers::Ble::NotificationMessage notificationMessage;
if (bleController.PopNotification(notificationMessage)) {
std::string m {notificationMessage.message, notificationMessage.size};
modal->Show(m);
// TODO delete message
}
}
break;
case Messages::TouchEvent: {
if (state != States::Running) break;
auto gesture = OnTouchEvent();