Skip to main content
ABN
Associate III
April 24, 2023
Solved

Read an attribute value from the local database

  • April 24, 2023
  • 2 replies
  • 1038 views

Hey!!

I have a BLE application which runs on custom server profile. There are few characteristics of a given service, where the client can modify them. I want to read these characteristics once they are updated by the client. I have tried to use "aci_gatt_read_handle_value" API but I'm not sure whether my implementation is correct or not.

My implementation:

 ZoneConfigurationStatus_t zoneStatus;

 aci_gatt_read_handle_value(CustomContext.CustomZone_Configuration_StatusHdle, 0, SizeZone_Configuration_Status, &SizeZone_Configuration_Status, &SizeZone_Configuration_Status, &zoneStatus);

 LOG_DEBUG("zoneStatus :%d", zoneStatus);

Can anyone help me out with this?

Thanks,

Akash

This topic has been closed for replies.
Best answer by Remy ISSALYS

Hello,

Using aci_gatt_read_handle_value command is the right way to read an attribute value from the local database. The handle of the value attribute is the characteristic handle + 1.

So, in your case the first parameter of aci_gatt_read_handle_value command should be CustomContext.CustomZone_Configuration_StatusHdle + 1

Best Regards

2 replies

Remy ISSALYS
Remy ISSALYSBest answer
Technical Moderator
April 25, 2023

Hello,

Using aci_gatt_read_handle_value command is the right way to read an attribute value from the local database. The handle of the value attribute is the characteristic handle + 1.

So, in your case the first parameter of aci_gatt_read_handle_value command should be CustomContext.CustomZone_Configuration_StatusHdle + 1

Best Regards

ABN
ABNAuthor
Associate III
April 25, 2023

@Remy ISSALYS​ 

Thanks. This change is working