summaryrefslogtreecommitdiff
path: root/src/components/ble/AlertNotificationService.h
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-04-18 20:28:14 +0300
committerAvamander <avamander@gmail.com>2021-04-24 11:39:53 +0300
commit40d45d923b033363ff1304b47eac238dd4495a57 (patch)
tree9e7b668fdf23a7be892b8e2bf8b4d62b884cee06 /src/components/ble/AlertNotificationService.h
parente56ebb8bd621cc8838e86fa032d680a6e7a35ffc (diff)
Reformatted all the files according to clang-format style
Diffstat (limited to 'src/components/ble/AlertNotificationService.h')
-rw-r--r--src/components/ble/AlertNotificationService.h84
1 files changed, 35 insertions, 49 deletions
diff --git a/src/components/ble/AlertNotificationService.h b/src/components/ble/AlertNotificationService.h
index caad7a2b..66bb9be4 100644
--- a/src/components/ble/AlertNotificationService.h
+++ b/src/components/ble/AlertNotificationService.h
@@ -7,8 +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}
+// 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 {
@@ -19,64 +20,49 @@ namespace Pinetime {
class NotificationManager;
class AlertNotificationService {
- public:
- AlertNotificationService(Pinetime::System::SystemTask &systemTask,
- Pinetime::Controllers::NotificationManager &notificationManager);
- void Init();
+ public:
+ AlertNotificationService(Pinetime::System::SystemTask& systemTask, Pinetime::Controllers::NotificationManager& notificationManager);
+ void Init();
- int OnAlert(uint16_t conn_handle, uint16_t attr_handle,
- struct ble_gatt_access_ctxt *ctxt);
+ int OnAlert(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt* ctxt);
- void AcceptIncomingCall();
- void RejectIncomingCall();
- void MuteIncomingCall();
+ void AcceptIncomingCall();
+ void RejectIncomingCall();
+ void MuteIncomingCall();
- enum class IncomingCallResponses : uint8_t {
- Reject = 0x00,
- Answer = 0x01,
- Mute = 0x02
- };
+ 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
- };
+ 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};
+ 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 ansUuid {.u {.type = BLE_UUID_TYPE_16}, .value = ansId};
- static constexpr ble_uuid16_t ansCharUuid {
- .u { .type = BLE_UUID_TYPE_16 },
- .value = ansCharId
- };
+ static constexpr ble_uuid16_t ansCharUuid {.u {.type = BLE_UUID_TYPE_16}, .value = ansCharId};
- static constexpr ble_uuid128_t notificationEventUuid {
- .u { .type = BLE_UUID_TYPE_128 },
- .value = NOTIFICATION_EVENT_SERVICE_UUID_BASE
- };
+ 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];
+ struct ble_gatt_chr_def characteristicDefinition[3];
+ struct ble_gatt_svc_def serviceDefinition[2];
- Pinetime::System::SystemTask &systemTask;
- NotificationManager &notificationManager;
+ Pinetime::System::SystemTask& systemTask;
+ NotificationManager& notificationManager;
- uint16_t eventHandle;
+ uint16_t eventHandle;
};
}
}