TI中文支持网
TI专业的中文技术问题搜集分享网站

simplelink_cc2640r2_sdk_4_10_00_10 中广播间隔改变?

C:\ti\simplelink_cc2640r2_sdk_4_10_00_10\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral 项目中广播间隔怎么改变,之前版本(simplelink_cc2640r2_sdk_1_40_00_45)可以通过DEFAULT_ADVERTISING_INTERVAL改变。sdk_4_10_00_10中找不到DEFAULT_ADVERTISING_INTERVAL设置值。

Kevin Qiu1:

有广播句柄时,更改广播间隔的方法是: //Advertising handleGapAdv_disable (advHandleLegacy );//Set advertisement interval parameteruint32_tnewAdvInt=200 ;GapAdv_setParam (advHandleLegacy , GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN , &newAdvInt );//Restart advertisement
GapAdv_enable (advHandleLegacy , GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0 );

yekun kun:

回复 Kevin Qiu1:

/// Default parameters for legacy, scannable, connectable advertising
#define GAPADV_PARAMS_LEGACY_SCANN_CONN {\.eventProps = GAP_ADV_PROP_CONNECTABLE | GAP_ADV_PROP_SCANNABLE |\GAP_ADV_PROP_LEGACY,\.primIntMin = 320,\.primIntMax = 320,\.primChanMap = GAP_ADV_CHAN_ALL,\.peerAddrType = PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID,\.peerAddr = { 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },\.filterPolicy = GAP_ADV_WL_POLICY_ANY_REQ,\.txPower = GAP_ADV_TX_POWER_NO_PREFERENCE,\.primPhy = GAP_ADV_PRIM_PHY_1_MBPS,\.secPhy = GAP_ADV_SEC_PHY_1_MBPS,\.sid = 0\
}

—–》// 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);

我在这里修改后有也可以将广播修改为200ms?是否也同样正确,你的是动态修改广播吗?

Kevin Qiu1:

回复 yekun kun:

从这里修改也可以,可以看下这里的说明:dev.ti.com/…/node

赞(0)
未经允许不得转载:TI中文支持网 » simplelink_cc2640r2_sdk_4_10_00_10 中广播间隔改变?
分享到: 更多 (0)