Skip to content

Commit

Permalink
Merge branch 'fix/build_release/v5.3' into 'feature/esp_as_mcu_host'
Browse files Browse the repository at this point in the history
fix the build for release/v5.3

See merge request app-frameworks/esp_hosted!511
  • Loading branch information
mantriyogesh committed Sep 24, 2024
2 parents 0d54404 + c3fd09f commit 555322a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
2 changes: 1 addition & 1 deletion idf_component.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "0.0.14"
version: "0.0.15"
description: ESP-Hosted provides driver such that any host can re-use ESP chipset as Wi-Fi or Bluetooth co-processor.
url: https://github.com/espressif/esp-hosted/tree/feature/esp_as_mcu_host
examples:
Expand Down
53 changes: 32 additions & 21 deletions slave/main/slave_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1603,6 +1603,7 @@ static esp_err_t req_wifi_sta_get_aid(Rpc *req, Rpc *resp, void *priv_data)

static esp_err_t req_wifi_set_protocols(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiSetProtocols, resp_wifi_set_protocols,
RpcReqWifiSetProtocols, req_wifi_set_protocols,
rpc__resp__wifi_set_protocols__init);
Expand All @@ -1613,24 +1614,23 @@ static esp_err_t req_wifi_set_protocols(Rpc *req, Rpc *resp, void *priv_data)
ifx = req_payload->ifx;
resp_payload->ifx = ifx;

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
wifi_protocols_t protocols;
protocols.ghz_2g = req_payload->protocols->ghz_2g;
protocols.ghz_5g = req_payload->protocols->ghz_5g;

ESP_LOGI(TAG, "set protocols: ghz_2g %d, ghz_5g %d", protocols.ghz_2g, protocols.ghz_5g);

RPC_RET_FAIL_IF(esp_wifi_set_protocols(ifx, &protocols));
#else
// not implemented
resp_payload->resp = ESP_FAIL;
#endif

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiGetProtocols, resp_wifi_get_protocols,
RpcReqWifiGetProtocols, req_wifi_get_protocols,
rpc__resp__wifi_get_protocols__init);
Expand All @@ -1639,7 +1639,6 @@ static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data)
ifx = req_payload->ifx;
resp_payload->ifx = ifx;

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
wifi_protocols_t protocols;

RPC_RET_FAIL_IF(esp_wifi_get_protocols(ifx, &protocols));
Expand All @@ -1649,17 +1648,17 @@ static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data)
resp_payload->protocols->ghz_5g = protocols.ghz_5g;

ESP_LOGI(TAG, "get protocols: ghz_2g %d, ghz_5g %d", protocols.ghz_2g, protocols.ghz_5g);
err:
return ESP_OK;
#else
// not implemented
resp_payload->resp = ESP_FAIL;
return ESP_FAIL;
#endif

err:
return ESP_OK;
}

static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiSetBandwidths, resp_wifi_set_bandwidths,
RpcReqWifiSetBandwidths, req_wifi_set_bandwidths,
rpc__resp__wifi_set_bandwidths__init);
Expand All @@ -1670,7 +1669,6 @@ static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
ifx = req_payload->ifx;
resp_payload->ifx = ifx;

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
wifi_bandwidths_t bw;

bw.ghz_2g = req_payload->bandwidths->ghz_2g;
Expand All @@ -1679,16 +1677,16 @@ static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
ESP_LOGI(TAG, "set bandwidths: ghz_2g %d, ghz_5g %d", bw.ghz_2g, bw.ghz_5g);

RPC_RET_FAIL_IF(esp_wifi_set_bandwidths(ifx, &bw));
#else
// not implemented
resp_payload->resp = ESP_FAIL;
#endif

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiGetBandwidths, resp_wifi_get_bandwidths,
RpcReqWifiGetBandwidths, req_wifi_get_bandwidths,
rpc__resp__wifi_get_bandwidths__init);
Expand All @@ -1697,7 +1695,6 @@ static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
ifx = req_payload->ifx;
resp_payload->ifx = ifx;

#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
wifi_bandwidths_t bw;

RPC_RET_FAIL_IF(esp_wifi_get_bandwidths(ifx, &bw));
Expand All @@ -1708,17 +1705,16 @@ static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
resp_payload->bandwidths->ghz_5g = bw.ghz_5g;

ESP_LOGI(TAG, "get bandwidths: ghz_2g %d, ghz_5g %d", bw.ghz_2g, bw.ghz_5g);
#else
// not implemented
resp_payload->resp = ESP_FAIL;
#endif

err:
return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_set_band(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiSetBand, resp_wifi_set_band,
RpcReqWifiSetBand, req_wifi_set_band,
rpc__resp__wifi_set_band__init);
Expand All @@ -1731,10 +1727,14 @@ static esp_err_t req_wifi_set_band(Rpc *req, Rpc *resp, void *priv_data)
RPC_RET_FAIL_IF(esp_wifi_set_band(band));

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_get_band(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE_SIMPLE(RpcRespWifiGetBand, resp_wifi_get_band,
RpcReqWifiGetBand, req_wifi_get_band,
rpc__resp__wifi_get_band__init);
Expand All @@ -1747,10 +1747,14 @@ static esp_err_t req_wifi_get_band(Rpc *req, Rpc *resp, void *priv_data)
ESP_LOGW(TAG, "get band: %d", band);

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_set_band_mode(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE(RpcRespWifiSetBandMode, resp_wifi_set_bandmode,
RpcReqWifiSetBandMode, req_wifi_set_bandmode,
rpc__resp__wifi_set_band_mode__init);
Expand All @@ -1763,10 +1767,14 @@ static esp_err_t req_wifi_set_band_mode(Rpc *req, Rpc *resp, void *priv_data)
RPC_RET_FAIL_IF(esp_wifi_set_band_mode(band_mode));

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

static esp_err_t req_wifi_get_band_mode(Rpc *req, Rpc *resp, void *priv_data)
{
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
RPC_TEMPLATE_SIMPLE(RpcRespWifiGetBandMode, resp_wifi_get_bandmode,
RpcReqWifiGetBandMode, req_wifi_get_bandmode,
rpc__resp__wifi_get_band_mode__init);
Expand All @@ -1779,6 +1787,9 @@ static esp_err_t req_wifi_get_band_mode(Rpc *req, Rpc *resp, void *priv_data)
ESP_LOGW(TAG, "get band_mode: %d", band_mode);

return ESP_OK;
#else
return ESP_FAIL;
#endif
}

#if 0
Expand Down
8 changes: 8 additions & 0 deletions slave/sdkconfig.defaults.esp32c5
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240

# BT Configuration
CONFIG_BT_ENABLED=y
CONFIG_BT_CONTROLLER_ONLY=y
CONFIG_BT_BLUEDROID_ENABLED=
CONFIG_BT_LE_SLEEP_ENABLE=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.esp32c5.csv"

0 comments on commit 555322a

Please sign in to comment.