5.睡眠模式下设置睡眠持续时间:
set_max_sleep_duration(QN_BLE_MAX_SLEEP_DUR); //设置睡眠时间#if (defined(CFG_BLE_MAX_SLEEP_DUR))#define QN_BLE_MAX_SLEEP_DUR CFG_BLE_MAX_SLEEP_DUR#else#define QN_BLE_MAX_SLEEP_DUR 0x320 // 625us * 0x320 = 0.5s#endif/// BLE MAX sleep duration#define CFG_BLE_MAX_SLEEP_DUR 0x3e80 // 625us * 0x3e80 = 10s
单位为625us,参数最大可设置为209715199,对应的最大睡眠时间大概是36小时16分钟。
6.修改广播时间间隔:
/// Minimum to maximum advertisement interval in any discoverable/// or connectable mode when user initiated: TGAP(adv_fast_interval1)/// recommended value: 30 to 60 ms; N * 0.625#define GAP_ADV_FAST_INTV1 0x00F0 //150ms/// Minimum to maximum advertisement interval in any discoverable/// or connectable mode when user initiated: TGAP(adv_fast_interval2)/// recommended value: 100 to 150 ms; N * 0.625#define GAP_ADV_FAST_INTV2 0x00F0 //150ms