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.

Keyfob广播时间问题



keyfob有限广播模式,例程上说是30.72s后停止广播,但实测发现广播时间为3分钟,后来又找到了

#define TGAP_LIM_ADV_TIMEOUT 1 //!< Maximum time to remain advertising, when in Limited Discoverable mode. In seconds (default 180 seconds)

说默认180s,那么问题:

如何修改广播时间为60s

  • 1、首先保证你的广播模式是Limited Discoverable mode即:

          #define DEFAULT_DISCOVERABLE_MODE             GAP_ADTYPE_FLAGS_LIMITED

    2、设置广播超时参数(TGAP_LIM_ADV_TIMEOUT),即:

           

    //Maximum time to remain advertising, when in Limited Discoverable mode. unit is seconds
    #define USER_DEF_ADV_TIMEOUT                               30

    GAP_SetParamValue( TGAP_LIM_ADV_TIMEOUT, USER_DEF_ADV_TIMEOUT );

    3、祝你好运!