如下图所示,上面第一幅图是我测的,设置广播间隔时间1s,为什么每一个1s间隔会出现两个这种波?
下面一副图和TI的蓝牙广播功耗分析里每次间隔只有一个波?
想知道怎么两个波怎么设置出来的,有什么用?怎么关闭来减少功耗?
Viki Shi:
下面那个电流波形才是正常的,有个recharge,请看一下这里recharge的解释:www.ti.com/…/swra478d.pdf 看错了,那个尖峰应该是唤醒进行广播的功耗 上面那个波形,看着像其他有任务在运行
yekun kun:
回复 Viki Shi:
我好像找到了:e2e.ti.com/…/880139
TI例程开了 advHandleLongRange 和 advHandleLongRange两个广播,我广播间隔设置都是1s ,所以一直一起出来,我把advHandleLongRange关了,大概正常了,只有充电电流和1s钟的广播电流。
static void SimplePeripheral_processGapMessage(gapEventHdr_t *pMsg)
{switch(pMsg->opcode){case GAP_DEVICE_INIT_DONE_EVENT:{bStatus_t status = FAILURE;
gapDeviceInitDoneEvent_t *pPkt = (gapDeviceInitDoneEvent_t *)pMsg;
if(pPkt->hdr.status == SUCCESS){// Store the system IDuint8_t systemId[DEVINFO_SYSTEM_ID_LEN];
// use 6 bytes of device address for 8 bytes of system ID valuesystemId[0] = pPkt->devAddr[0];systemId[1] = pPkt->devAddr[1];systemId[2] = pPkt->devAddr[2];
// set middle bytes to zerosystemId[4] = 0x00;systemId[3] = 0x00;
// shift three bytes upsystemId[7] = pPkt->devAddr[5];systemId[6] = pPkt->devAddr[4];systemId[5] = pPkt->devAddr[3];
// Set Device Info Service ParameterDevInfo_SetParameter(DEVINFO_SYSTEM_ID, DEVINFO_SYSTEM_ID_LEN, systemId);
Display_printf(dispHandle, SP_ROW_STATUS_1, 0, "Initialized");
// Setup and start Advertising// For more information, see the GAP section in the User's Guide:// software-dl.ti.com/…/
// Temporary memory for advertising parameters for set #1. These will be copied// by the GapAdv moduleGapAdv_params_t advParamLegacy = GAPADV_PARAMS_LEGACY_SCANN_CONN;
// Create Advertisement set #1 and assign handlestatus = GapAdv_create(&SimplePeripheral_advCallback, &advParamLegacy,&advHandleLegacy);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);
// Load advertising data for set #1 that is statically allocated by the appstatus = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_ADV,sizeof(advertData), advertData);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);
// Load scan response data for set #1 that is statically allocated by the appstatus = GapAdv_loadByHandle(advHandleLegacy, GAP_ADV_DATA_TYPE_SCAN_RSP,sizeof(scanRspData), scanRspData);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);
// Set event mask for set #1status = GapAdv_setEventMask(advHandleLegacy,GAP_ADV_EVT_MASK_START_AFTER_ENABLE |GAP_ADV_EVT_MASK_END_AFTER_DISABLE |GAP_ADV_EVT_MASK_SET_TERMINATED);
// Enable legacy advertising for set #1status = GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);//// Use long range params to create long range set #2
//GapAdv_params_t advParamLongRange = GAPADV_PARAMS_AE_LONG_RANGE_CONN;
//
//// Create Advertisement set #2 and assign handle
//status = GapAdv_create(&SimplePeripheral_advCallback, &advParamLongRange,
//&advHandleLongRange);
//SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);
//
//// Load advertising data for set #2 that is statically allocated by the app
//status = GapAdv_loadByHandle(advHandleLongRange, GAP_ADV_DATA_TYPE_ADV,
//sizeof(advertData), advertData);
//SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);
//
//// Set event mask for set #2
//status = GapAdv_setEventMask(advHandleLongRange,
//GAP_ADV_EVT_MASK_START_AFTER_ENABLE |
//GAP_ADV_EVT_MASK_END_AFTER_DISABLE |
//GAP_ADV_EVT_MASK_SET_TERMINATED);
//
//// Enable long range advertising for set #2
//status = GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
//SIMPLEPERIPHERAL_ASSERT(status == SUCCESS);#ifdef PTM_MODE
直接这里注释应该没问题把?
Viki Shi:
回复 yekun kun:
可以