change Notification Event UUID

This commit is contained in:
petter 2021-01-08 14:21:52 +01:00
parent 10ba20876f
commit 2d90571f0d
2 changed files with 8 additions and 6 deletions

View file

@ -9,7 +9,7 @@ using namespace Pinetime::Controllers;
constexpr ble_uuid16_t AlertNotificationService::ansUuid; constexpr ble_uuid16_t AlertNotificationService::ansUuid;
constexpr ble_uuid16_t AlertNotificationService::ansCharUuid; constexpr ble_uuid16_t AlertNotificationService::ansCharUuid;
constexpr ble_uuid16_t AlertNotificationService::ansEventUuid; constexpr ble_uuid128_t AlertNotificationService::notificationEventUuid;
int AlertNotificationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { int AlertNotificationCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) {
@ -35,7 +35,7 @@ AlertNotificationService::AlertNotificationService ( System::SystemTask& systemT
.flags = BLE_GATT_CHR_F_WRITE .flags = BLE_GATT_CHR_F_WRITE
}, },
{ {
.uuid = (ble_uuid_t *) &ansEventUuid, .uuid = (ble_uuid_t *) &notificationEventUuid,
.access_cb = AlertNotificationCallback, .access_cb = AlertNotificationCallback,
.arg = this, .arg = this,
.flags = BLE_GATT_CHR_F_NOTIFY, .flags = BLE_GATT_CHR_F_NOTIFY,

View file

@ -7,6 +7,9 @@
#undef max #undef max
#undef min #undef min
//c7e50000-78fc-48fe-8e23-433b3a1942d1
#define NOTIFICATION_EVENT_SERVICE_UUID_BASE {0xd1, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7}
namespace Pinetime { namespace Pinetime {
namespace System { namespace System {
@ -45,7 +48,6 @@ namespace Pinetime {
static constexpr uint16_t ansId {0x1811}; static constexpr uint16_t ansId {0x1811};
static constexpr uint16_t ansCharId {0x2a46}; static constexpr uint16_t ansCharId {0x2a46};
static constexpr uint16_t ansEventCharId = {0x2a47};
static constexpr ble_uuid16_t ansUuid { static constexpr ble_uuid16_t ansUuid {
.u { .type = BLE_UUID_TYPE_16 }, .u { .type = BLE_UUID_TYPE_16 },
@ -57,9 +59,9 @@ namespace Pinetime {
.value = ansCharId .value = ansCharId
}; };
static constexpr ble_uuid16_t ansEventUuid { static constexpr ble_uuid128_t notificationEventUuid {
.u { .type = BLE_UUID_TYPE_16 }, .u { .type = BLE_UUID_TYPE_128 },
.value = ansEventCharId .value = NOTIFICATION_EVENT_SERVICE_UUID_BASE
}; };
struct ble_gatt_chr_def characteristicDefinition[3]; struct ble_gatt_chr_def characteristicDefinition[3];