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.

CC2640R2F 主机向从机怎么发送数据

Expert 2260 points
Other Parts Discussed in Thread: CC2640R2F

CC2640R2F 主机怎么向从机发送数据 , 有函数接口吗?

我用下面的程序发送数据, 很容易出现发送失败. 这个程序发送数据有时间间隔要求吗?

attWriteReq_t att;
att.pValue = GATT_bm_alloc(charHdl, ATT_WRITE_REQ, sendstrlen[sendcount % MAXSENDSIZE], NULL);
if(att.pValue != NULL)
{
att.handle = charHdl;
att.len = sendstrlen[sendcount % MAXSENDSIZE];
osal_memcpy(att.pValue, sendstr[sendcount % MAXSENDSIZE], sendstrlen[sendcount % MAXSENDSIZE]);
att.sig = 0;
att.cmd = 0;

if(GATT_WriteCharValue(connHandle, &att, selfEntity) == SUCCESS)
{
#ifdef USER_DEBUGUART
UART_Send(sendstr[sendcount % MAXSENDSIZE], sendstrlen[sendcount % MAXSENDSIZE]);
#endif
DeleteSendString();
}
else
{
GATT_bm_free((gattMsg_t *)&att, ATT_WRITE_REQ);
}
}