From d1ed9bd90b45c1edbdf2c99e9589c19d09ca2d75 Mon Sep 17 00:00:00 2001 From: Jozef Mlich Date: Sun, 26 Jan 2025 08:33:33 +0100 Subject: [PATCH] Add Model characteristics to Device Info Service --- src/hardware/ble/deviceinfo.cpp | 2 ++ src/hardware/ble/deviceinfo.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/hardware/ble/deviceinfo.cpp b/src/hardware/ble/deviceinfo.cpp index c14c8d56..628110e9 100644 --- a/src/hardware/ble/deviceinfo.cpp +++ b/src/hardware/ble/deviceinfo.cpp @@ -37,6 +37,8 @@ void deviceinfo_setup( void ) { pManufacturerNameStringCharacteristic->setValue("Lily Go"); NimBLECharacteristic* pFirmwareRevisionStringCharacteristic = pDeviceInformationService->createCharacteristic( FIRMWARE_REVISION_STRING_CHARACTERISTIC_UUID, NIMBLE_PROPERTY::READ ); pFirmwareRevisionStringCharacteristic->setValue(__FIRMWARE__); + NimBLECharacteristic* pModelStringCharacteristic = pDeviceInformationService->createCharacteristic( MODEL_STRING_CHARACTERISTIC_UUID, NIMBLE_PROPERTY::READ ); + pModelStringCharacteristic->setValue(HARDWARE_NAME); pDeviceInformationService->start(); pAdvertising->addServiceUUID( pDeviceInformationService->getUUID() ); #endif diff --git a/src/hardware/ble/deviceinfo.h b/src/hardware/ble/deviceinfo.h index e4a7fda5..ea61f812 100644 --- a/src/hardware/ble/deviceinfo.h +++ b/src/hardware/ble/deviceinfo.h @@ -28,6 +28,7 @@ #define DEVICE_INFORMATION_SERVICE_UUID (uint16_t)0x180A /** @brief Device Information server UUID */ #define MANUFACTURER_NAME_STRING_CHARACTERISTIC_UUID (uint16_t)0x2A29 /** @brief Device Information - manufacturer name string UUID */ #define FIRMWARE_REVISION_STRING_CHARACTERISTIC_UUID (uint16_t)0x2A26 /** @brief Device Information - firmware revision UUID */ + #define MODEL_STRING_CHARACTERISTIC_UUID (uint16_t)0x2A24 /** @brief Device Information - model UUID */ /** * @brief setup gadgetbridge transmit/recieve over ble */