diff options
| author | JF <jf@codingfield.com> | 2020-05-17 08:29:13 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2020-05-17 08:29:13 (GMT) |
| commit | 8a94750e30399bfb204cbec59a769d9d1b6b5baa (patch) | |
| tree | 8a1a58beae54e238d28aff116c900f3b428b7db4 /src/Components/Ble/AlertNotificationService.h | |
| parent | 86d5732b960fbe7f81ed711b2de7e6b79293c96a (diff) | |
| parent | be1ad9b07083e656a649d223750ff4b14b781b7b (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/Components/Ble/AlertNotificationService.h')
| -rw-r--r-- | src/Components/Ble/AlertNotificationService.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Components/Ble/AlertNotificationService.h b/src/Components/Ble/AlertNotificationService.h new file mode 100644 index 0000000..53cb44c --- /dev/null +++ b/src/Components/Ble/AlertNotificationService.h @@ -0,0 +1,39 @@ +#pragma once +#include <cstdint> +#include <array> +#include <host/ble_gap.h> + +namespace Pinetime { + namespace Controllers { + class AlertNotificationService { + public: + AlertNotificationService(Pinetime::System::SystemTask &systemTask, + Pinetime::Controllers::NotificationManager ¬ificationManager); + void Init(); + + int OnAlert(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt); + + + private: + static constexpr uint16_t ansId {0x1811}; + static constexpr uint16_t ansCharId {0x2a46}; + + static constexpr ble_uuid16_t ansUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ansId + }; + + static constexpr ble_uuid16_t ansCharUuid { + .u { .type = BLE_UUID_TYPE_16 }, + .value = ansCharId + }; + + struct ble_gatt_chr_def characteristicDefinition[2]; + struct ble_gatt_svc_def serviceDefinition[2]; + + Pinetime::System::SystemTask &m_systemTask; + NotificationManager &m_notificationManager; + }; + } +} |
