From 487ae478adf4f4c8be0ff61f8433e7018426b661 Mon Sep 17 00:00:00 2001 From: Jonathan Vander Mey Date: Sat, 24 Jul 2021 11:40:06 -0400 Subject: Remove unnecessary C-style casts with BLE UUIDs Instead of casting the UUID object to the ble_uuid_t* used throughout the NimBLE API just pass the address of the ble_uuid_t member that's at the start of each of the UUID structs. --- src/components/ble/ImmediateAlertService.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/ble/ImmediateAlertService.cpp') diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp index 820d3b6e..17ed1a96 100644 --- a/src/components/ble/ImmediateAlertService.cpp +++ b/src/components/ble/ImmediateAlertService.cpp @@ -32,7 +32,7 @@ ImmediateAlertService::ImmediateAlertService(Pinetime::System::SystemTask& syste Pinetime::Controllers::NotificationManager& notificationManager) : systemTask {systemTask}, notificationManager {notificationManager}, - characteristicDefinition {{.uuid = (ble_uuid_t*) &alertLevelUuid, + characteristicDefinition {{.uuid = &alertLevelUuid.u, .access_cb = AlertLevelCallback, .arg = this, .flags = BLE_GATT_CHR_F_WRITE_NO_RSP, @@ -41,7 +41,7 @@ ImmediateAlertService::ImmediateAlertService(Pinetime::System::SystemTask& syste serviceDefinition { {/* Device Information Service */ .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t*) &immediateAlertServiceUuid, + .uuid = &immediateAlertServiceUuid.u, .characteristics = characteristicDefinition}, {0}, } { @@ -72,4 +72,4 @@ int ImmediateAlertService::OnAlertLevelChanged(uint16_t connectionHandle, uint16 } return 0; -} \ No newline at end of file +} -- cgit v1.2.3