cancel
Showing results for 
Search instead for 
Did you mean: 

BLUENRG - aci_gatt_add_serv() description of parameter max_attr_records

maik
Associate
Posted on August 02, 2014 at 17:45

Hello,

there is one parameter in aci_gatt_add_serv() which needs clarification: max_attr_records

Looking at the documentation and the sample code (the comment there suggest that even the st programer of the sample code was confused) does not give an answer to fully understand this parameter.

Right now I have to use trial and error to find a working value. When looking at the parameter name it suggest that it is the maximum number of attribute records. However it looks like you have to double the actual amount of attribute records of the service and add 2 or 3 to get the correct number. Using lower numbers will result in a wrong service announcement and a non working device.

tBleStatus

aci_gatt_add_serv

(

tHalUint8

service_uuid_type

,

const

tHalUint8

*

service_uuid

,

tHalUint8

service_type

,

tHalUint8

max_attr_records

,

tHalUint16

*

serviceHandle

);

Please give a calculation example for this parameter.

Thanks,

Maik
1 REPLY 1
Posted on September 12, 2014 at 17:06

Hi Maik,

The Max_Attribute_Records parameter specifies the maximum number of attribute records that can be added to this service (including the service attribute, include attribute, characteristic attribute,characteristic value attribute and characteristic descriptor attribute).

You have to considered that each characteristic uses at least 2 attributes (declaration and value), plus other attributes for each included descriptor.

For example, if the characteristic has the notify property then you have to considered +3 attributes for this characteristic.

Therefore, if you add a service with two characteristics with Notification, you have to considered 2*3 attributes +1 for the service, in total the Max_Attribute_Records should be equal to 7.

Regards,

Graziella