diff options
| author | JF002 <JF002@users.noreply.github.com> | 2021-02-14 12:03:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-14 12:03:49 +0100 |
| commit | 4c3803450e33e321dd2f90bdf62b9abe99f1e491 (patch) | |
| tree | 1b69be394c55dce4cbe64750dae6603bfd33b09c /src/components/ble/AlertNotificationService.h | |
| parent | 6420885abb96735e085f3c60b123b0c671a7afb8 (diff) | |
| parent | d4c31bcbbe2f8b6d2e6c45203193745f9cb2a41b (diff) | |
Merge pull request #161 from petterhs/calls
Call functionality with changed UUID for notification event characteristic
Diffstat (limited to 'src/components/ble/AlertNotificationService.h')
| -rw-r--r-- | src/components/ble/AlertNotificationService.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/components/ble/AlertNotificationService.h b/src/components/ble/AlertNotificationService.h index 120312d2..caad7a2b 100644 --- a/src/components/ble/AlertNotificationService.h +++ b/src/components/ble/AlertNotificationService.h @@ -7,6 +7,9 @@ #undef max #undef min +//00020001-78fc-48fe-8e23-433b3a1942d0 +#define NOTIFICATION_EVENT_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x01, 0x00, 0x02, 0x00} + namespace Pinetime { namespace System { @@ -24,8 +27,31 @@ namespace Pinetime { int OnAlert(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt); + void AcceptIncomingCall(); + void RejectIncomingCall(); + void MuteIncomingCall(); + + enum class IncomingCallResponses : uint8_t { + Reject = 0x00, + Answer = 0x01, + Mute = 0x02 + }; private: + enum class Categories : uint8_t { + SimpleAlert = 0x00, + Email = 0x01, + News = 0x02, + Call = 0x03, + MissedCall = 0x04, + MmsSms = 0x05, + VoiceMail = 0x06, + Schedule = 0x07, + HighPrioritizedAlert = 0x08, + InstantMessage = 0x09, + All = 0xff + }; + static constexpr uint16_t ansId {0x1811}; static constexpr uint16_t ansCharId {0x2a46}; @@ -39,11 +65,18 @@ namespace Pinetime { .value = ansCharId }; - struct ble_gatt_chr_def characteristicDefinition[2]; + static constexpr ble_uuid128_t notificationEventUuid { + .u { .type = BLE_UUID_TYPE_128 }, + .value = NOTIFICATION_EVENT_SERVICE_UUID_BASE + }; + + struct ble_gatt_chr_def characteristicDefinition[3]; struct ble_gatt_svc_def serviceDefinition[2]; Pinetime::System::SystemTask &systemTask; NotificationManager ¬ificationManager; + + uint16_t eventHandle; }; } } |
