mirror of
https://github.com/espressif/esp-idf.git
synced 2026-08-03 20:35:33 +02:00
fix(esp_wifi): Remove deprecated NAN API variables in examples
This commit is contained in:
committed by
Kapil Gupta
parent
f12debf4f5
commit
a82788180c
@@ -114,9 +114,6 @@ static void nan_receive_event_handler(void *arg, esp_event_base_t event_base,
|
||||
if (evt->ssi_len) {
|
||||
ESP_LOGI(TAG, "Received payload from Peer "MACSTR" [Peer Service id - %d] - ", MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
ESP_LOG_BUFFER_HEXDUMP(TAG, evt->ssi, evt->ssi_len, ESP_LOG_INFO);
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Received message '%s' from Peer "MACSTR" [Peer Service id - %d]",
|
||||
evt->peer_svc_info, MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,7 +287,6 @@ static int wifi_cmd_nan_publish(int argc, char **argv)
|
||||
{
|
||||
int nerrors = arg_parse(argc, argv, (void **) &pub_args);
|
||||
uint32_t pub_id;
|
||||
bool ndp_resp_needed = false;
|
||||
|
||||
if (nerrors != 0) {
|
||||
arg_print_errors(stderr, pub_args.end, argv[0]);
|
||||
@@ -324,7 +320,7 @@ static int wifi_cmd_nan_publish(int argc, char **argv)
|
||||
strlcpy(publish.matching_filter, pub_args.filter->sval[0], ESP_WIFI_MAX_SVC_NAME_LEN);
|
||||
}
|
||||
|
||||
if (!esp_wifi_nan_publish_service(&publish, ndp_resp_needed)) {
|
||||
if (!esp_wifi_nan_publish_service(&publish)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -50,9 +50,6 @@ static void nan_receive_event_handler(void *arg, esp_event_base_t event_base,
|
||||
if (evt->ssi_len) {
|
||||
ESP_LOGI(TAG, "Received payload from Peer "MACSTR" [Peer Service id - %d] - ", MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
ESP_LOG_BUFFER_HEXDUMP(TAG, evt->ssi, evt->ssi_len, ESP_LOG_INFO);
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Received message '%s' from Peer "MACSTR" [Peer Service id - %d]",
|
||||
evt->peer_svc_info, MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
}
|
||||
xEventGroupSetBits(nan_event_group, NAN_RECEIVE);
|
||||
}
|
||||
@@ -83,12 +80,6 @@ void wifi_nan_publish(void)
|
||||
NULL,
|
||||
&instance_any_id));
|
||||
|
||||
/* ndp_require_consent
|
||||
* If set to false - All incoming NDP requests will be internally accepted if valid.
|
||||
* If set to true - All incoming NDP requests raise NDP_INDICATION event, upon which application can either accept or reject them.
|
||||
*/
|
||||
bool ndp_require_consent = true;
|
||||
|
||||
/* Start NAN Discovery */
|
||||
wifi_nan_config_t nan_cfg = WIFI_NAN_CONFIG_DEFAULT();
|
||||
|
||||
@@ -112,9 +103,12 @@ void wifi_nan_publish(void)
|
||||
#endif
|
||||
.matching_filter = EXAMPLE_NAN_MATCHING_FILTER,
|
||||
.single_replied_event = 1,
|
||||
/* 0 - All incoming NDP requests will be internally accepted,
|
||||
1 - All incoming NDP requests raise NDP_INDICATION event and require esp_wifi_nan_datapath_resp to accept or reject. */
|
||||
.ndp_resp_needed = 1,
|
||||
};
|
||||
|
||||
pub_id = esp_wifi_nan_publish_service(&publish_cfg, ndp_require_consent);
|
||||
pub_id = esp_wifi_nan_publish_service(&publish_cfg);
|
||||
if (pub_id == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,9 +52,6 @@ static void nan_receive_event_handler(void *arg, esp_event_base_t event_base,
|
||||
if (evt->ssi_len) {
|
||||
ESP_LOGI(TAG, "Received payload from Peer "MACSTR" [Peer Service id - %d] - ", MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
ESP_LOG_BUFFER_HEXDUMP(TAG, evt->ssi, evt->ssi_len, ESP_LOG_INFO);
|
||||
} else {
|
||||
ESP_LOGI(TAG, "Received message '%s' from Peer "MACSTR" [Peer Service id - %d]",
|
||||
evt->peer_svc_info, MAC2STR(evt->peer_if_mac), evt->peer_inst_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user