fix(ble_mesh): Fix compiling error when PB-ADV is disabled

Closes https://github.com/espressif/esp-idf/issues/13203
This commit is contained in:
Liu Linyan 2024-02-20 16:27:41 +08:00
parent 4a3f224fe1
commit 63ba58e9a8
3 changed files with 14 additions and 8 deletions

View File

@ -141,6 +141,11 @@ bool bt_mesh_prov_pdu_check(uint8_t type, uint16_t length, uint8_t *reason)
#define XACT_SEG_DATA(link, _seg) (&link->rx.buf->data[20 + (((_seg) - 1) * 23)])
#define XACT_SEG_RECV(link, _seg) (link->rx.seg &= ~(1 << (_seg)))
static uint8_t bt_mesh_prov_buf_type_get(struct net_buf_simple *buf)
{
return buf->data[PROV_BUF_HEADROOM];
}
uint8_t node_next_xact_id(struct bt_mesh_prov_link *link)
{
if (link->tx.id != 0 && link->tx.id != 0xFF) {
@ -677,6 +682,13 @@ int bt_mesh_prov_send(struct bt_mesh_prov_link *link, struct net_buf_simple *buf
#endif /* CONFIG_BLE_MESH_PB_GATT */
#if CONFIG_BLE_MESH_PB_ADV
if (bt_mesh_prov_buf_type_get(buf) == PROV_FAILED) {
/* For case MESH/NODE/PROV/BV-10-C, Node must send Transaction
* ACK before Provisioning Failed message is transmitted.
*/
bt_mesh_gen_prov_ack_send(link, link->rx.id);
}
return bt_mesh_prov_send_adv(link, buf);
#endif /* CONFIG_BLE_MESH_PB_ADV */

View File

@ -179,12 +179,6 @@ static void prov_send_fail_msg(uint8_t err)
{
PROV_BUF(buf, 2);
/**
* For the case MESH/NODE/PROV/BV-10-C, Node must send Transaction ACK
* before Provisioning Failed message is transmitted.
*/
bt_mesh_gen_prov_ack_send(&prov_link, prov_link.rx.id);
bt_mesh_prov_buf_init(&buf, PROV_FAILED);
net_buf_simple_add_u8(&buf, err);

View File

@ -1311,13 +1311,13 @@ void bt_mesh_ext_prov_clear_tx(void *link, bool cancel)
uint8_t bt_mesh_ext_prov_node_next_xact_id(void *link)
{
#if CONFIG_BLE_MESH_NODE
#if CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_ADV
extern uint8_t node_next_xact_id(struct bt_mesh_prov_link *link);
return node_next_xact_id(link);
#else
assert(0);
return 0;
#endif /* CONFIG_BLE_MESH_NODE */
#endif /* CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_ADV */
}
void *bt_mesh_ext_prov_node_get_link(void)