From 35570edafab1b061442ae89b01a2ced8b9a812bd Mon Sep 17 00:00:00 2001 From: liamcharger <105521623+liamcharger@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:58:51 -0400 Subject: [PATCH] Add bootloader to DeviceInformationService.cpp --- src/components/ble/DeviceInformationService.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/ble/DeviceInformationService.cpp b/src/components/ble/DeviceInformationService.cpp index f0d1b5a7..6f2ed762 100644 --- a/src/components/ble/DeviceInformationService.cpp +++ b/src/components/ble/DeviceInformationService.cpp @@ -9,6 +9,7 @@ constexpr ble_uuid16_t DeviceInformationService::fwRevisionUuid; constexpr ble_uuid16_t DeviceInformationService::deviceInfoUuid; constexpr ble_uuid16_t DeviceInformationService::hwRevisionUuid; constexpr ble_uuid16_t DeviceInformationService::swRevisionUuid; +constexpr ble_uuid16_t DeviceInformationService::bootloaderVersionUuid; int DeviceInformationCallback(uint16_t /*conn_handle*/, uint16_t /*attr_handle*/, struct ble_gatt_access_ctxt* ctxt, void* arg) { auto deviceInformationService = static_cast(arg); @@ -46,6 +47,9 @@ int DeviceInformationService::OnDeviceInfoRequested(struct ble_gatt_access_ctxt* case swRevisionId: str = swRevision; break; + case bootloaderVersionId: + str = bootloaderVersion; + break; default: return BLE_ATT_ERR_UNLIKELY; } @@ -91,6 +95,12 @@ DeviceInformationService::DeviceInformationService() .arg = this, .flags = BLE_GATT_CHR_F_READ, }, + { + .uuid = &bootloaderVersionUuid.u, + .access_cb = DeviceInformationCallback, + .arg = this, + .flags = BLE_GATT_CHR_F_READ, + }, {0}}, serviceDefinition { {/* Device Information Service */