This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Maximum number of services

Hi,

Could you tell me please the maximum supporting number of services?

This number may be varied depending on number of attributes in each service and its size. So how can I evaluate maximum size of GATT table?

I decided to create several services and at some point 'sd_ble_gatts_characteristic_add()' returned 'NRF_ERROR_NO_MEM'.

Also I interested in what cases it is advantageous to use option BLE_GATTS_VLOC_USER. For example, I have attribute with length 1 byte. If I use BLE_GATTS_VLOC_USER, I think, stack will have pointer to my data (size of pointer = 4 bytes). If I use BLE_GATTS_VLOC_STACK, does is take 1 byte in table inside Stack?

Best regards, Artem Zemlyanukhin

Parents
  • Hi there,

    Could you tell me please the maximum supporting number of services?

    There really is not a maximum number of services in the attribute table. Instead, the table is allocated a fixed number of bytes in memory and you fill those in when you add attributes in general, until space runs out and no more can be added.

    This number may be varied depending on number of attributes in each service and its size. So how can I evaluate maximum size of GATT table?

    Unfortunately at this point you cannot with exactitude. You will have to try and fit what you need until you run out of memory. We have not made the layout of our internal table public, and so I cannot give you exact numbers.

    Also I interested in what cases it is advantageous to use option BLE_GATTS_VLOC_USER. For example, I have attribute with length 1 byte. If I use BLE_GATTS_VLOC_USER, I think, stack will have pointer to my data (size of pointer = 4 bytes). If I use BLE_GATTS_VLOC_STACK, does is take 1 byte in table inside Stack?

    The internal pointer exists regardless of the vloc type you use. Hence the more attributes with BLE_GATTS_VLOC_USER the less space you will take inside our attribute table and the more services/characteristics/descriptors you will be able to fit.

    Regards,

    Carles

  • No, CCCDs as of today have to live inside the stack. The reason for that is that it is the stack itself the one that actually creates them.

Reply Children
No Data
Related