cancel
Showing results for 
Search instead for 
Did you mean: 

Read an attribute value from the local database

ABN
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Remy ISSALYS
ST Employee

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

View solution in original post

2 REPLIES 2
Remy ISSALYS
ST Employee

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
Associate III

@Remy ISSALYS​ 

Thanks. This change is working