Hi,
I would like to get the stored CCCD values of a bonded peer using pm_peer_data_load()
uint32_t peerCount = pm_peer_count();
if (peerCount <= MAX_NUMBER_OF_BONDS)
{
pm_peer_id_t peerList[MAX_NUMBER_OF_BONDS] = {0U};
if (NRF_SUCCESS == pm_peer_id_list(&peerList[0], &peerCount, PM_PEER_ID_INVALID, PM_PEER_ID_LIST_ALL_ID))
{
for (uint8_t i = 0U; i < peerCount; i++)
{
uint32_t peerDataGattLocal[128] = {0U};
uint32_t peerDataGattLocalLen = sizeof(peerDataGattLocal);
NSDS_t_nrferrorCode errorCode = pm_peer_data_load(peerList[i], PM_PEER_DATA_ID_GATT_LOCAL, &peerDataGattLocal[0], &peerDataGattLocalLen);
switch (errorCode)
{
case NRF_SUCCESS:
NRF_LOG_INFO("pm_peer_data_load returned %d bytes:", peerDataGattLocalLen);
NRF_LOG_HEXDUMP_INFO(uint8_t*) &peerDataGattLocal[0], peerDataGattLocalLen);
break;
case NRF_ERROR_INVALID_PARAM:
case NRF_ERROR_NULL:
case NRF_ERROR_NOT_FOUND:
case NRF_ERROR_DATA_SIZE:
case NRF_ERROR_INVALID_STATE:
default:
NRF_LOG_INFO("pm_peer_data_load returned\t0x%x", errorCode);
break;
}
}
}
}
I am currently struggling with the format of the data returned by pm_peer_data_load(). The output looks like this:
pm_peer_data_load returned 512 bytes:
03 00 00 00 44 00 0D 00|....D...
02 00 02 00 20 00 02 00|.... ...
02 00 23 00 02 00 02 00|..#.....
27 00 02 00 02 00 2A 00|'.....*.
02 00 02 00 2D 00 02 00|....-...
02 00 32 00 02 00 02 00|..2.....
35 00 02 00 02 00 38 00|5.....8.
02 00 01 00 3B 00 02 00|....;...
02 00 3E 00 02 00 01 00|..>.....
00 1D 00 00 00 00 00 00|........
I see that the data contains CCCD Handle / Value pairs but I would like to understand the format in detail. Unfortunately I can't find something about it in the documentation. Could you please guide me into the right direction?
Thanks
Florian