mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
Add bootloader to DeviceInformationService.cpp
This commit is contained in:
parent
05d4e875f4
commit
35570edafa
|
@ -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<DeviceInformationService*>(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 */
|
||||
|
|
Loading…
Reference in a new issue