CC2640R2 IAR
请问通过GATT_Notification 发送数据,如果知道数据实际已经发送到主机端,以便下一次调用?
我这边有大量的数据需要发送,如果发送过快就会出现蓝牙重启的问题。如何实现这个功能呢?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
CC2640R2 IAR
请问通过GATT_Notification 发送数据,如果知道数据实际已经发送到主机端,以便下一次调用?
我这边有大量的数据需要发送,如果发送过快就会出现蓝牙重启的问题。如何实现这个功能呢?
你好,非常感谢你的答复。
uint16_t Retstatus = SUCCESS;
bStatus_t Sendstatus = SUCCESS;
attHandleValueNoti_t Char2_Noti;
if(INVALID_CONNHANDLE == connHandle)
{
return INVALIDPARAMETER;
}
if(SIMPLEPROFILE_CHAR2 == Param)
{
Retstatus = GATTServApp_ReadCharCfg(connHandle, simpleProfileChar2Config);
if(Retstatus & GATT_CLIENT_CFG_NOTIFY)
{
Char2_Noti.pValue = GATT_bm_alloc(connHandle, ATT_HANDLE_VALUE_NOTI, len, NULL);
if(Char2_Noti.pValue != NULL)
{
Char2_Noti.handle = simpleProfileAttrTbl[5].handle;
Char2_Noti.len = len;
memcpy(Char2_Noti.pValue, pValue, len);
Sendstatus = GATT_Notification(connHandle, &Char2_Noti, FALSE);
if(Sendstatus != SUCCESS)
{
GATT_bm_free((gattMsg_t *)&Char2_Noti, ATT_HANDLE_VALUE_NOTI);
}
}
else
{
//GATT_bm_free((gattMsg_t *)&Char2_Noti, ATT_HANDLE_VALUE_NOTI);
Sendstatus = FAILURE;
}
}
}
return Sendstatus;
我还有几个问题请教:
1.距离比较远的环境下 调用 GATT_Notification 时,有时候会返回0x16,这个返回值代表什么呢?
2.这种情况下,我GATT_bm_alloc申请的缓冲区,是否需要我释放?
1. 0x16 是blePending,代表notification送不出去
2.用完的缓冲区都要释放
1. 試著降低connection interval
2. 應該就是會出現blepending
3. 一直调用GATT_bm_alloc 不free可能会導致memory 不足而重启