各位好,请问蓝牙在广播时,广播信息里有没有带蓝牙地址?如果没有,我想增加进去改如何修改?
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_ProcessGAPMsg()对GAP_DEVICE_INIT_DONE_EVENT的处理。这里在addr加入到advertising data。
case GAP_DEVICE_INIT_DONE_EVENT:
{
gapDeviceInitDoneEvent_t *pPkt = (gapDeviceInitDoneEvent_t *)pMsg;
bStatus_t stat = pPkt->hdr.status;
if ( stat == SUCCESS )
{
// Save off the generated keys
VOID osal_snv_write( BLE_NVID_IRK, KEYLEN, gapRole_IRK );
VOID osal_snv_write( BLE_NVID_CSRK, KEYLEN, gapRole_SRK );
// Save off the information
VOID osal_memcpy( gapRole_bdAddr, pPkt->devAddr, B_ADDR_LEN );
gapRole_state = GAPROLE_STARTED;
// Update the advertising data
stat = GAP_UpdateAdvertisingData( gapRole_TaskID,
TRUE, gapRole_AdvertDataLen, gapRole_AdvertData );
}
if ( stat != SUCCESS )
{
gapRole_state = GAPROLE_ERROR;
}
notify = TRUE;
}
break;
我想问一下怎么设置连接时间为1s 因为我追踪到
static void gapRole_ProcessGAPMsg( gapEventHdr_t *pMsg )
{
case GAP_LINK_PARAM_UPDATE_EVENT:
{
NPI_WriteTransport("14\n",3);
gapLinkUpdateEvent_t *pPkt = (gapLinkUpdateEvent_t *)pMsg;
// Cancel connection param update timeout timer (if active)
VOID osal_stop_timerEx( gapRole_TaskID, CONN_PARAM_TIMEOUT_EVT );
if ( pPkt->hdr.status == SUCCESS )
{
// Store new connection parameters
gapRole_ConnInterval = pPkt->connInterval;
gapRole_ConnSlaveLatency = pPkt->connLatency;
gapRole_ConnTimeout = pPkt->connTimeout;
printv(gapRole_ConnInterval);
// Make sure there's no pending connection update procedure
if ( osal_get_timeoutEx( gapRole_TaskID, START_CONN_UPDATE_EVT ) == 0 )
{
// Notify the application with the new connection parameters
if ( pGapRoles_ParamUpdateCB != NULL )
{
NPI_WriteTransport("15\n",3);
(*pGapRoles_ParamUpdateCB)( gapRole_ConnInterval,
gapRole_ConnSlaveLatency,
gapRole_ConnTimeout );
}
}
}
}
break;
}
可是static gapRolesParamUpdateCB_t *pGapRoles_ParamUpdateCB=NULL ;
导致无法修改连接时间
我想问一下 怎么实现这个函数 这个函数里面做一些什么。由于回调函数学的不是很好,麻烦指点一下,谢谢了