急。。。 连接失败不产生GAP_LINK_ESTABLISHED_EVENT事件,并且以后搜索再也搜索不到设备。
case GAP_LINK_ESTABLISHED_EVENT:
{
if ( pEvent->gap.hdr.status == SUCCESS )
{
#ifdef DEBUGGER
NPI_WriteTransport("connection successful\r\n",osal_strlen("connection successful\r\n"));
#endif
........
.....
}
else
{
#ifdef DEBUGGER
NPI_WriteTransport("connection error\r\n",osal_strlen("connection error\r\n"));
#endif
....
....
}
连接成功后会产生GAP_LINK_ESTABLISHED_EVENT事件,并且会打印“connection successful”;
可是我乱输入一个mac地址连接,不会产生GAP_LINK_ESTABLISHED_EVENT,啥都不会打印。而且以后搜索就再也搜索不到设备了。
这是连接参数:
bStatus_t GAPCentralRole_EstablishLink( uint8 highDutyCycle, uint8 whiteList,
uint8 addrTypePeer, uint8 *peerAddr )
{
gapEstLinkReq_t params;
params.taskID = gapCentralRoleTaskId;
params.highDutyCycle = highDutyCycle; //False
params.whiteList = whiteList; //list
params.addrTypePeer = addrTypePeer;
VOID osal_memcpy( params.peerAddr, peerAddr, B_ADDR_LEN );
return GAP_EstablishLinkReq( ¶ms );
}