2021-05-23 05:41 AM
Hi,
What is the general rule for computing the max attributes records parameter for:
aci_gatt_add_service
Can you supply a general formula for all characteristic types:
#define CHAR_PROP_NONE 0x00U
#define CHAR_PROP_BROADCAST 0x01U
#define CHAR_PROP_READ 0x02U
#define CHAR_PROP_WRITE_WITHOUT_RESP 0x04U
#define CHAR_PROP_WRITE 0x08U
#define CHAR_PROP_NOTIFY 0x10u
#define CHAR_PROP_INDICATE 0x20U
#define CHAR_PROP_SIGNED_WRITE 0x40U
#define CHAR_PROP_EXT 0x80U
Thanks!
2021-08-11 07:06 AM
Some information can be found in AN5289 chapter 7.6.4. But need to be completed.
Formula for GATT database needs is (in bytes):
(number of services) x 48 + (number of attributes) x 40 + CFG_BLE_ATT_VALUE_ARRAY_SIZE
with CFG_BLE_ATT_VALUE_ARRAY_SIZE = 1344 (defined in app_conf.h)
The max size cannot be changed by the user's FW, the limitation is resulting from the M0+ FW stack.
The size allocated for each service and characteristic is linked to the GATT specification.
The max size is different for the different stacks, calculation is done in M0 under different conditions
For WB55 full stack, the max value is 10.5kbytes
For WB55 light stack, the max value is the same as the full one.
The size will depend on the flash/SRAM size, sizes are different for WB15 => only 2.7KB for the full BLE stack.
and depends also on the presence of THREAD stack.
See the joined picture.