您好,CC2642的SDK没有这个函数吧 GAPRole_SetParameter();
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.
GAPROLE_CONNHANDLE 这个是GAPRole_SetParameter里的参数, GapAdv_enable()里是handle这个参数: Handle of advertising set to enable
你可以看一下simple peripheral 里的代码实现:
static void SimplePeripheral_processConnEvt(Gap_ConnEventRpt_t *pReport)
{
// Get index from handle
uint8_t connIndex = SimplePeripheral_getConnIndex(pReport->handle);
if (connIndex >= MAX_NUM_BLE_CONNS)
{
Display_printf(dispHandle, SP_ROW_STATUS_1, 0, "Connection handle is not in the connList !!!");
return;
}
// If auto phy change is enabled
if (connList[connIndex].isAutoPHYEnable == TRUE)
{
// Read the RSSI
HCI_ReadRssiCmd(pReport->handle);
}
}
这里是通过结构体pReport,也就是Gap_ConnEventRpt_t,这个在gap.h里定义,代码如下:
typedef struct
{
GAP_ConnEvtStat_t status; //!< status of connection event
uint16_t handle; //!< connection handle
uint8_t channel; //!< BLE RF channel index (0-39)
GAP_ConnEvtPhy_t phy; //!< PHY of connection event
int8_t lastRssi; //!< RSSI of last packet received
/// Number of packets received for this connection event
uint16_t packets;
/// Total number of CRC errors for the entire connection
uint16_t errors;
/// Type of next BLE task
GAP_ConnEvtTaskType_t nextTaskType;
/// Time to next BLE task (in us). 0xFFFFFFFF if there is no next task.
uint32_t nextTaskTime;
} Gap_ConnEventRpt_t;