|
2 | 2 |
|
3 | 3 | /* |
4 | 4 | * SPDX-FileCopyrightText: 2017 Intel Corporation |
5 | | - * SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD |
| 5 | + * SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD |
6 | 6 | * |
7 | 7 | * SPDX-License-Identifier: Apache-2.0 |
8 | 8 | */ |
@@ -170,6 +170,11 @@ static void proxy_sar_timeout(struct k_work *work) |
170 | 170 | bt_mesh_gatts_disconnect(client->conn, 0x13); |
171 | 171 | } |
172 | 172 |
|
| 173 | +void bt_mesh_proxy_server_adv_flag_set(bool enable) |
| 174 | +{ |
| 175 | + proxy_adv_enabled = enable; |
| 176 | +} |
| 177 | + |
173 | 178 | #if CONFIG_BLE_MESH_GATT_PROXY_SERVER |
174 | 179 | /** |
175 | 180 | * The following callbacks are used to notify proper information |
@@ -853,7 +858,9 @@ static void proxy_connected(struct bt_mesh_conn *conn, uint8_t err) |
853 | 858 | conn_count++; |
854 | 859 |
|
855 | 860 | /* Since we use ADV_OPT_ONE_TIME */ |
856 | | - proxy_adv_enabled = false; |
| 861 | +#if !CONFIG_BLE_MESH_USE_BLE_50 |
| 862 | + bt_mesh_proxy_server_adv_flag_set(false); |
| 863 | +#endif |
857 | 864 |
|
858 | 865 | #if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX |
859 | 866 | /* Before re-enabling advertising, stop advertising |
@@ -1498,7 +1505,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub) |
1498 | 1505 | return err; |
1499 | 1506 | } |
1500 | 1507 |
|
1501 | | - proxy_adv_enabled = true; |
| 1508 | + bt_mesh_proxy_server_adv_flag_set(true); |
1502 | 1509 |
|
1503 | 1510 | return 0; |
1504 | 1511 | } |
@@ -1529,7 +1536,7 @@ static int net_id_adv(struct bt_mesh_subnet *sub) |
1529 | 1536 | return err; |
1530 | 1537 | } |
1531 | 1538 |
|
1532 | | - proxy_adv_enabled = true; |
| 1539 | + bt_mesh_proxy_server_adv_flag_set(true); |
1533 | 1540 |
|
1534 | 1541 | return 0; |
1535 | 1542 | } |
@@ -1592,7 +1599,7 @@ static int private_node_id_adv(struct bt_mesh_subnet *sub) |
1592 | 1599 | return err; |
1593 | 1600 | } |
1594 | 1601 |
|
1595 | | - proxy_adv_enabled = true; |
| 1602 | + bt_mesh_proxy_server_adv_flag_set(true); |
1596 | 1603 |
|
1597 | 1604 | return 0; |
1598 | 1605 | } |
@@ -1636,7 +1643,7 @@ static int private_net_id_adv(struct bt_mesh_subnet *sub) |
1636 | 1643 | return err; |
1637 | 1644 | } |
1638 | 1645 |
|
1639 | | - proxy_adv_enabled = true; |
| 1646 | + bt_mesh_proxy_server_adv_flag_set(true); |
1640 | 1647 |
|
1641 | 1648 | return 0; |
1642 | 1649 | } |
@@ -1902,7 +1909,7 @@ int32_t bt_mesh_proxy_server_adv_start(void) |
1902 | 1909 | prov_sd, prov_sd_len) == 0) { |
1903 | 1910 | #endif /* CONFIG_BLE_MESH_USE_BLE_50 */ |
1904 | 1911 |
|
1905 | | - proxy_adv_enabled = true; |
| 1912 | + bt_mesh_proxy_server_adv_flag_set(true); |
1906 | 1913 |
|
1907 | 1914 | /* Advertise 60 seconds using fast interval */ |
1908 | 1915 | if (prov_fast_adv) { |
@@ -1959,7 +1966,7 @@ int bt_mesh_proxy_server_adv_stop(void) |
1959 | 1966 | return -EINVAL; |
1960 | 1967 | } |
1961 | 1968 |
|
1962 | | - proxy_adv_enabled = false; |
| 1969 | + bt_mesh_proxy_server_adv_flag_set(false); |
1963 | 1970 | return 0; |
1964 | 1971 | } |
1965 | 1972 |
|
@@ -2022,7 +2029,7 @@ int bt_mesh_proxy_server_deinit(void) |
2022 | 2029 | proxy_adv_inst = BLE_MESH_ADV_INS_UNUSED; |
2023 | 2030 | #endif |
2024 | 2031 |
|
2025 | | - proxy_adv_enabled = false; |
| 2032 | + bt_mesh_proxy_server_adv_flag_set(false); |
2026 | 2033 | gatt_svc = MESH_GATT_NONE; |
2027 | 2034 |
|
2028 | 2035 | #if CONFIG_BLE_MESH_GATT_PROXY_SERVER |
|
0 commit comments