Skip to content

Commit 44895c0

Browse files
committed
Merge branch 'fix/ble_mesh_solic_tx_pdu_fix' into 'master'
fix(ble_mesh): fixed issues with proxy solic pdu adv Closes BLERP-1931 See merge request espressif/esp-idf!39480
2 parents 713a63f + ca30088 commit 44895c0

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

components/bt/esp_ble_mesh/core/adv.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,16 @@ static inline int adv_send(struct net_buf *buf)
9494
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
9595
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
9696
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
97-
struct bt_mesh_adv_data solic_ad[3] = {
98-
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
97+
struct bt_mesh_adv_data solic_ad[2] = {
9998
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
10099
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
101100
};
102101
#if CONFIG_BLE_MESH_USE_BLE_50
103102
param.primary_phy = BLE_MESH_ADV_PHY_1M;
104103
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
105-
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, &ad, 3, NULL, 0);
104+
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
106105
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
107-
err = bt_le_adv_start(&param, &ad, 3, NULL, 0);
106+
err = bt_le_adv_start(&param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
108107
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
109108
} else
110109
#endif

components/bt/esp_ble_mesh/core/adv_common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,9 @@ void bt_mesh_adv_common_init(void)
625625
bt_mesh_adv_type_init(BLE_MESH_ADV_DATA, &adv_queue, &adv_buf_pool, adv_alloc);
626626
bt_mesh_adv_type_init(BLE_MESH_ADV_BEACON, &adv_queue, &adv_buf_pool, adv_alloc);
627627
bt_mesh_adv_type_init(BLE_MESH_ADV_URI, &adv_queue, &adv_buf_pool, adv_alloc);
628+
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
629+
bt_mesh_adv_type_init(BLE_MESH_ADV_PROXY_SOLIC, &adv_queue, &adv_buf_pool, adv_alloc);
630+
#endif
628631

629632
#if CONFIG_BLE_MESH_USE_BLE_50
630633
bt_mesh_adv_inst_init(BLE_MESH_ADV_INS, CONFIG_BLE_MESH_ADV_INST_ID);

components/bt/esp_ble_mesh/core/adv_common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ enum bt_mesh_adv_type {
140140
#endif
141141
BLE_MESH_ADV_BEACON,
142142
BLE_MESH_ADV_URI,
143+
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
144+
BLE_MESH_ADV_PROXY_SOLIC,
145+
#endif
143146
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
144147
BLE_MESH_ADV_BLE,
145148
#endif

components/bt/esp_ble_mesh/core/ext_adv.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
7070
#endif
7171
#if CONFIG_BLE_MESH_RELAY_ADV_BUF
7272
case BLE_MESH_ADV_RELAY_DATA:
73+
#endif
74+
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
75+
case BLE_MESH_ADV_PROXY_SOLIC:
7376
#endif
7477
case BLE_MESH_ADV_BEACON:
7578
case BLE_MESH_ADV_URI: {
@@ -96,9 +99,20 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
9699
param.primary_phy = BLE_MESH_ADV_PHY_1M;
97100
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
98101

99-
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
100-
101-
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
102+
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
103+
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
104+
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
105+
struct bt_mesh_adv_data solic_ad[2] = {
106+
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
107+
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
108+
};
109+
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
110+
} else
111+
#endif
112+
{
113+
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
114+
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
115+
}
102116
}
103117
break;
104118
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV

components/bt/esp_ble_mesh/lib/ext.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ uint8_t __meshlib_var_BLE_MESH_ADV_RELAY_DATA = BLE_MESH_ADV_RELAY_DATA;
9292
#endif
9393
uint8_t __meshlib_var_BLE_MESH_ADV_BEACON = BLE_MESH_ADV_BEACON;
9494
uint8_t __meshlib_var_BLE_MESH_ADV_URI = BLE_MESH_ADV_URI;
95+
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
96+
uint8_t __meshlib_var_BLE_MESH_ADV_PROXY_SOLIC = BLE_MESH_ADV_PROXY_SOLIC;
97+
#endif
9598
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
9699
uint8_t __meshlib_var_BLE_MESH_ADV_BLE = BLE_MESH_ADV_BLE;
97100
#endif

0 commit comments

Comments
 (0)