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/CurrentTimeService.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/ble/CurrentTimeService.cpp') diff --git a/src/components/ble/CurrentTimeService.cpp b/src/components/ble/CurrentTimeService.cpp index b49be39c..eefb7ec1 100644 --- a/src/components/ble/CurrentTimeService.cpp +++ b/src/components/ble/CurrentTimeService.cpp @@ -53,7 +53,7 @@ int CurrentTimeService::OnTimeAccessed(uint16_t conn_handle, uint16_t attr_handl } CurrentTimeService::CurrentTimeService(DateTime& dateTimeController) - : characteristicDefinition {{.uuid = (ble_uuid_t*) &ctChrUuid, + : characteristicDefinition {{.uuid = &ctChrUuid.u, .access_cb = CTSCallback, .arg = this, @@ -62,7 +62,7 @@ CurrentTimeService::CurrentTimeService(DateTime& dateTimeController) serviceDefinition { {/* Device Information Service */ .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = (ble_uuid_t*) &ctsUuid, + .uuid = &ctsUuid.u, .characteristics = characteristicDefinition}, {0}, }, -- cgit v1.2.3-70-g09d2