I have asked the developers if they could take a look and make some recommendations.
1 of 1 people found this helpful
bleprofile_WriteHandle function only updates GATT database in the RAM. The function which writes to the NVRAM is bleprofile_WriteNVRAM. Indeed it is better to write a whole chunk into NVRAM rather than several small ones. If it is acceptable from your application point of view, it would be better to collect 64 bytes of data and then call Write NVRAM function.
So then it's your expectation that each byte stored in the database will take ~2ms to commit? That seems excessively slow to me. I am using the calls provided by the Smart Designer, which do NOT call writeNVRAM:
// It should be called when 'Device Name' is changed.
BOOL store_in_db_generic_access_device_name(UINT8* p_value, UINT8 value_len)
// Write value to the GATT DB
ble_trace2("write len:%d handle:%02x", value_len, HDLC_GENERIC_ACCESS_DEVICE_NAME_VALUE);
memcpy(&db_pdu.pdu, p_value, value_len);
db_pdu.len = value_len;