Просмотр исходного кода

feat(bt/bluedroid): Support high duty adv interval setting

chenjianhua 2 лет назад
Родитель
Сommit
e43e4b83fc

+ 7 - 0
components/bt/host/bluedroid/Kconfig.in

@@ -1150,3 +1150,10 @@ config BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
     default n
     help
         This enables BLE periodic advertising sync transfer feature
+
+config BT_BLE_HIGH_DUTY_ADV_INTERVAL
+    bool "Enable BLE high duty advertising interval feature"
+    depends on BT_BLUEDROID_ENABLED
+    default n
+    help
+        This enable BLE high duty advertising interval feature

+ 6 - 0
components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h

@@ -137,6 +137,12 @@
 #define UC_BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER            FALSE
 #endif
 
+#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
+#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
+#else
+#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL FALSE
+#endif
+
 //GATTS
 #ifdef CONFIG_BT_GATTS_ENABLE
 #define UC_BT_GATTS_ENABLE                  CONFIG_BT_GATTS_ENABLE

+ 6 - 0
components/bt/host/bluedroid/common/include/common/bt_target.h

@@ -198,6 +198,12 @@
 #define BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER   FALSE
 #endif
 
+#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
+#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
+#else
+#define BLE_HIGH_DUTY_ADV_INTERVAL FALSE
+#endif
+
 #if (UC_BT_BLE_RPA_SUPPORTED  == TRUE)
 #define CONTROLLER_RPA_LIST_ENABLE   TRUE
 #else

+ 6 - 2
components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h

@@ -105,8 +105,12 @@ typedef UINT8   tBTM_BLE_SFP;
 #endif
 
 /* adv parameter boundary values */
-#define BTM_BLE_ADV_INT_MIN            0x0020
-#define BTM_BLE_ADV_INT_MAX            0x4000
+#if BLE_HIGH_DUTY_ADV_INTERVAL
+#define BTM_BLE_ADV_INT_MIN            0x0008  /* 5ms */
+#else
+#define BTM_BLE_ADV_INT_MIN            0x0020  /* 20ms */
+#endif
+#define BTM_BLE_ADV_INT_MAX            0x4000  /* 10240ms */
 
 /* Full scan boundary values */
 #define BTM_BLE_ADV_SCAN_FULL_MIN      0x00