请问一下,
如果想实现无间隔广播(一直处于广播状态),有什么方法实现。
我是将广播间隔设置成0,发现无法正常广播,程序应该是挂掉了。
代码如下:
GapAdv_disable(advHandleLongRange);
GapAdv_disable(advHandleLegacy);
uint16_t advInt = 0;
// GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MIN, advInt);
// GAP_SetParamValue(TGAP_LIM_DISC_ADV_INT_MAX, advInt);
// GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MIN, advInt);
// GAP_SetParamValue(TGAP_GEN_DISC_ADV_INT_MAX, advInt);
GapAdv_setParam( advHandleLegacy, GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN, &advInt);
GapAdv_setParam( advHandleLegacy, GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX, &advInt);
GapAdv_setParam( advHandleLongRange, GAP_ADV_PARAM_PRIMARY_INTERVAL_MIN, &advInt);
GapAdv_setParam( advHandleLongRange, GAP_ADV_PARAM_PRIMARY_INTERVAL_MAX, &advInt);
GapAdv_enable(advHandleLegacy, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
GapAdv_enable(advHandleLongRange, GAP_ADV_ENABLE_OPTIONS_USE_MAX , 0);
请问有什么建议吗? |