Skip to content

Commit

Permalink
Merge pull request #434 from wqx6/network_prov/fix_unused_warning
Browse files Browse the repository at this point in the history
fix(network_prov): Fix warning of unused_function or unused_variable (IEC-227)
  • Loading branch information
chshu authored Nov 11, 2024
2 parents 884934d + 0b2454b commit d3e5a00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion network_provisioning/idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "1.0.2"
version: "1.0.3"
description: Network provisioning component for Wi-Fi or Thread devices
url: https://github.com/espressif/idf-extra-components/tree/master/network_provisioning
dependencies:
Expand Down
2 changes: 2 additions & 0 deletions network_provisioning/src/handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "network_provisioning/manager.h"
#include "network_provisioning_priv.h"

#if defined(CONFIG_NETWORK_PROV_NETWORK_TYPE_WIFI) || defined(CONFIG_NETWORK_PROV_NETWORK_TYPE_THREAD)
static const char *TAG = "network_prov_handlers";

/* Provide definition of network_prov_ctx_t */
Expand All @@ -40,6 +41,7 @@ static void free_network_prov_ctx(network_prov_ctx_t **ctx)
free(*ctx);
*ctx = NULL;
}
#endif

#ifdef CONFIG_NETWORK_PROV_NETWORK_TYPE_WIFI
static wifi_config_t *get_wifi_config(network_prov_ctx_t **ctx)
Expand Down
9 changes: 5 additions & 4 deletions network_provisioning/src/network_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static esp_err_t cmd_scan_start_handler(NetworkScanPayload *req,
NetworkScanPayload *resp, void *priv_data)
{
network_prov_scan_handlers_t *h = (network_prov_scan_handlers_t *) priv_data;
if (!priv_data) {
if (!h) {
ESP_LOGE(TAG, "Command invoked without handlers");
return ESP_ERR_INVALID_STATE;
}
Expand Down Expand Up @@ -175,9 +175,9 @@ static esp_err_t cmd_scan_status_handler(NetworkScanPayload *req,
static esp_err_t cmd_scan_result_handler(NetworkScanPayload *req,
NetworkScanPayload *resp, void *priv_data)
{
esp_err_t err;
esp_err_t err = ESP_OK;
network_prov_scan_handlers_t *h = (network_prov_scan_handlers_t *) priv_data;
if (!priv_data) {
if (!h) {
ESP_LOGE(TAG, "Command invoked without handlers");
return ESP_ERR_INVALID_STATE;
}
Expand Down Expand Up @@ -328,9 +328,10 @@ static esp_err_t cmd_scan_result_handler(NetworkScanPayload *req,
}
#else // CONFIG_NETWORK_PROV_NETWORK_TYPE_THREAD
resp->status = STATUS__InvalidArgument;
err = ESP_ERR_INVALID_ARG;
#endif // !CONFIG_NETWORK_PROV_NETWORK_TYPE_THREAD
}
return ESP_OK;
return err;
}


Expand Down

0 comments on commit d3e5a00

Please sign in to comment.