mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-16 00:49:16 +00:00
fix(ble_mesh): Remote Provisioning Client/Server bugs fixed
This commit is contained in:
@@ -1506,6 +1506,11 @@ void bt_mesh_ext_prov_link_set_expect(void *link, uint8_t val)
|
||||
LINK(link)->expect = val;
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_ext_prov_link_get_expect(void *link)
|
||||
{
|
||||
return LINK(link)->expect;
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_ext_prov_link_get_pub_key_type(void *link)
|
||||
{
|
||||
return LINK(link)->public_key;
|
||||
@@ -1633,6 +1638,16 @@ uint8_t *bt_mesh_ext_prov_link_get_pb_remote_uuid(void *link)
|
||||
return LINK(link)->pb_remote_uuid;
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_prov_link_get_prot_timer(void *link)
|
||||
{
|
||||
return &(LINK(link)->prot_timer);
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_prov_link_get_with_work(void *work)
|
||||
{
|
||||
return CONTAINER_OF(work, struct bt_mesh_prov_link, prot_timer.work);
|
||||
}
|
||||
|
||||
uint8_t bt_mesh_ext_prov_link_get_pb_remote_timeout(void *link)
|
||||
{
|
||||
return LINK(link)->pb_remote_timeout;
|
||||
@@ -2049,9 +2064,18 @@ int bt_mesh_ext_rpr_cli_pdu_recv(void *link, uint8_t type, struct net_buf_simple
|
||||
}
|
||||
|
||||
#if CONFIG_BLE_MESH_RPR_CLI
|
||||
static struct bt_mesh_prov_link rpr_links[CONFIG_BLE_MESH_RPR_CLI_PROV_SAME_TIME];
|
||||
struct bt_mesh_prov_link rpr_links[CONFIG_BLE_MESH_RPR_CLI_PROV_SAME_TIME];
|
||||
#endif /* CONFIG_BLE_MESH_RPR_CLI */
|
||||
|
||||
bool bt_mesh_ext_is_unprov_dev_being_provision(void *uuid)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_RPR_CLI
|
||||
return is_unprov_dev_being_provision(uuid);
|
||||
#else
|
||||
assert(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void *bt_mesh_ext_rpr_cli_get_rpr_link(uint8_t index)
|
||||
{
|
||||
#if CONFIG_BLE_MESH_RPR_CLI
|
||||
@@ -2083,15 +2107,13 @@ int bt_mesh_ext_rpr_srv_nppi_pdu_recv(uint8_t type, const uint8_t *data)
|
||||
|
||||
int bt_mesh_ext_rpr_srv_set_waiting_prov_link(void* link, bt_mesh_addr_t *addr)
|
||||
{
|
||||
#if (CONFIG_BLE_MESH_GATT_PROXY_CLIENT && \
|
||||
CONFIG_BLE_MESH_PB_GATT && \
|
||||
#if (CONFIG_BLE_MESH_PB_GATT && \
|
||||
CONFIG_BLE_MESH_RPR_SRV)
|
||||
return bt_mesh_rpr_srv_set_waiting_prov_link(link, addr);
|
||||
#else
|
||||
assert(0);
|
||||
return 0;
|
||||
#endif /* (CONFIG_BLE_MESH_GATT_PROXY_CLIENT && \
|
||||
CONFIG_BLE_MESH_PB_GATT && \
|
||||
#endif /* CONFIG_BLE_MESH_PB_GATT && \
|
||||
CONFIG_BLE_MESH_RPR_SRV) */
|
||||
}
|
||||
|
||||
@@ -4011,6 +4033,7 @@ typedef struct {
|
||||
uint64_t config_ble_mesh_srpl_cli : 1;
|
||||
uint64_t config_ble_mesh_srpl_srv : 1;
|
||||
|
||||
uint32_t config_ble_mesh_prov_protocol_timeout;
|
||||
uint16_t config_ble_mesh_record_frag_max_size;
|
||||
uint16_t config_ble_mesh_crpl;
|
||||
uint16_t config_ble_mesh_proxy_solic_rx_crpl;
|
||||
@@ -4176,7 +4199,7 @@ static const bt_mesh_ext_config_t bt_mesh_ext_cfg = {
|
||||
.config_ble_mesh_sar_srv = IS_ENABLED(CONFIG_BLE_MESH_SAR_SRV),
|
||||
.config_ble_mesh_srpl_cli = IS_ENABLED(CONFIG_BLE_MESH_SRPL_CLI),
|
||||
.config_ble_mesh_srpl_srv = IS_ENABLED(CONFIG_BLE_MESH_SRPL_SRV),
|
||||
|
||||
.config_ble_mesh_prov_protocol_timeout = PROTOCOL_TIMEOUT,
|
||||
#if CONFIG_BLE_MESH_CERT_BASED_PROV
|
||||
.config_ble_mesh_record_frag_max_size = CONFIG_BLE_MESH_RECORD_FRAG_MAX_SIZE,
|
||||
#endif /* CONFIG_BLE_MESH_CERT_BASED_PROV */
|
||||
@@ -4511,6 +4534,7 @@ typedef struct {
|
||||
int (*_bt_mesh_ext_rpr_cli_pdu_send)(void *link, uint8_t type);
|
||||
int (*_bt_mesh_ext_rpr_cli_recv_pub_key_outbound_report)(void *link);
|
||||
int (*_bt_mesh_ext_rpr_cli_pdu_recv)(void *link, uint8_t type, struct net_buf_simple *buf);
|
||||
bool (*_bt_mesh_ext_is_unprov_dev_being_provision)(void *uuid);
|
||||
void *(*_bt_mesh_ext_rpr_cli_get_rpr_link)(uint8_t index);
|
||||
/* CONFIG_BLE_MESH_RPR_CLI */
|
||||
|
||||
@@ -4832,6 +4856,7 @@ static const bt_mesh_ext_funcs_t bt_mesh_ext_func = {
|
||||
._bt_mesh_ext_rpr_cli_pdu_send = bt_mesh_ext_rpr_cli_pdu_send,
|
||||
._bt_mesh_ext_rpr_cli_recv_pub_key_outbound_report = bt_mesh_ext_rpr_cli_recv_pub_key_outbound_report,
|
||||
._bt_mesh_ext_rpr_cli_pdu_recv = bt_mesh_ext_rpr_cli_pdu_recv,
|
||||
._bt_mesh_ext_is_unprov_dev_being_provision = bt_mesh_ext_is_unprov_dev_being_provision,
|
||||
._bt_mesh_ext_rpr_cli_get_rpr_link = bt_mesh_ext_rpr_cli_get_rpr_link,
|
||||
/* CONFIG_BLE_MESH_RPR_CLI */
|
||||
|
||||
|
Reference in New Issue
Block a user