@@ -1603,6 +1603,7 @@ static esp_err_t req_wifi_sta_get_aid(Rpc *req, Rpc *resp, void *priv_data)
1603
1603
1604
1604
static esp_err_t req_wifi_set_protocols (Rpc * req , Rpc * resp , void * priv_data )
1605
1605
{
1606
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1606
1607
RPC_TEMPLATE (RpcRespWifiSetProtocols , resp_wifi_set_protocols ,
1607
1608
RpcReqWifiSetProtocols , req_wifi_set_protocols ,
1608
1609
rpc__resp__wifi_set_protocols__init );
@@ -1613,24 +1614,23 @@ static esp_err_t req_wifi_set_protocols(Rpc *req, Rpc *resp, void *priv_data)
1613
1614
ifx = req_payload -> ifx ;
1614
1615
resp_payload -> ifx = ifx ;
1615
1616
1616
- #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1617
1617
wifi_protocols_t protocols ;
1618
1618
protocols .ghz_2g = req_payload -> protocols -> ghz_2g ;
1619
1619
protocols .ghz_5g = req_payload -> protocols -> ghz_5g ;
1620
1620
1621
1621
ESP_LOGI (TAG , "set protocols: ghz_2g %d, ghz_5g %d" , protocols .ghz_2g , protocols .ghz_5g );
1622
1622
1623
1623
RPC_RET_FAIL_IF (esp_wifi_set_protocols (ifx , & protocols ));
1624
- #else
1625
- // not implemented
1626
- resp_payload -> resp = ESP_FAIL ;
1627
- #endif
1628
1624
1629
1625
return ESP_OK ;
1626
+ #else
1627
+ return ESP_FAIL ;
1628
+ #endif
1630
1629
}
1631
1630
1632
1631
static esp_err_t req_wifi_get_protocols (Rpc * req , Rpc * resp , void * priv_data )
1633
1632
{
1633
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1634
1634
RPC_TEMPLATE (RpcRespWifiGetProtocols , resp_wifi_get_protocols ,
1635
1635
RpcReqWifiGetProtocols , req_wifi_get_protocols ,
1636
1636
rpc__resp__wifi_get_protocols__init );
@@ -1639,7 +1639,6 @@ static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data)
1639
1639
ifx = req_payload -> ifx ;
1640
1640
resp_payload -> ifx = ifx ;
1641
1641
1642
- #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1643
1642
wifi_protocols_t protocols ;
1644
1643
1645
1644
RPC_RET_FAIL_IF (esp_wifi_get_protocols (ifx , & protocols ));
@@ -1649,17 +1648,17 @@ static esp_err_t req_wifi_get_protocols(Rpc *req, Rpc *resp, void *priv_data)
1649
1648
resp_payload -> protocols -> ghz_5g = protocols .ghz_5g ;
1650
1649
1651
1650
ESP_LOGI (TAG , "get protocols: ghz_2g %d, ghz_5g %d" , protocols .ghz_2g , protocols .ghz_5g );
1651
+ err :
1652
+ return ESP_OK ;
1652
1653
#else
1653
- // not implemented
1654
- resp_payload -> resp = ESP_FAIL ;
1654
+ return ESP_FAIL ;
1655
1655
#endif
1656
1656
1657
- err :
1658
- return ESP_OK ;
1659
1657
}
1660
1658
1661
1659
static esp_err_t req_wifi_set_bandwidths (Rpc * req , Rpc * resp , void * priv_data )
1662
1660
{
1661
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1663
1662
RPC_TEMPLATE (RpcRespWifiSetBandwidths , resp_wifi_set_bandwidths ,
1664
1663
RpcReqWifiSetBandwidths , req_wifi_set_bandwidths ,
1665
1664
rpc__resp__wifi_set_bandwidths__init );
@@ -1670,7 +1669,6 @@ static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
1670
1669
ifx = req_payload -> ifx ;
1671
1670
resp_payload -> ifx = ifx ;
1672
1671
1673
- #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1674
1672
wifi_bandwidths_t bw ;
1675
1673
1676
1674
bw .ghz_2g = req_payload -> bandwidths -> ghz_2g ;
@@ -1679,16 +1677,16 @@ static esp_err_t req_wifi_set_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
1679
1677
ESP_LOGI (TAG , "set bandwidths: ghz_2g %d, ghz_5g %d" , bw .ghz_2g , bw .ghz_5g );
1680
1678
1681
1679
RPC_RET_FAIL_IF (esp_wifi_set_bandwidths (ifx , & bw ));
1682
- #else
1683
- // not implemented
1684
- resp_payload -> resp = ESP_FAIL ;
1685
- #endif
1686
1680
1687
1681
return ESP_OK ;
1682
+ #else
1683
+ return ESP_FAIL ;
1684
+ #endif
1688
1685
}
1689
1686
1690
1687
static esp_err_t req_wifi_get_bandwidths (Rpc * req , Rpc * resp , void * priv_data )
1691
1688
{
1689
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1692
1690
RPC_TEMPLATE (RpcRespWifiGetBandwidths , resp_wifi_get_bandwidths ,
1693
1691
RpcReqWifiGetBandwidths , req_wifi_get_bandwidths ,
1694
1692
rpc__resp__wifi_get_bandwidths__init );
@@ -1697,7 +1695,6 @@ static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
1697
1695
ifx = req_payload -> ifx ;
1698
1696
resp_payload -> ifx = ifx ;
1699
1697
1700
- #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1701
1698
wifi_bandwidths_t bw ;
1702
1699
1703
1700
RPC_RET_FAIL_IF (esp_wifi_get_bandwidths (ifx , & bw ));
@@ -1708,17 +1705,16 @@ static esp_err_t req_wifi_get_bandwidths(Rpc *req, Rpc *resp, void *priv_data)
1708
1705
resp_payload -> bandwidths -> ghz_5g = bw .ghz_5g ;
1709
1706
1710
1707
ESP_LOGI (TAG , "get bandwidths: ghz_2g %d, ghz_5g %d" , bw .ghz_2g , bw .ghz_5g );
1711
- #else
1712
- // not implemented
1713
- resp_payload -> resp = ESP_FAIL ;
1714
- #endif
1715
-
1716
1708
err :
1717
1709
return ESP_OK ;
1710
+ #else
1711
+ return ESP_FAIL ;
1712
+ #endif
1718
1713
}
1719
1714
1720
1715
static esp_err_t req_wifi_set_band (Rpc * req , Rpc * resp , void * priv_data )
1721
1716
{
1717
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1722
1718
RPC_TEMPLATE (RpcRespWifiSetBand , resp_wifi_set_band ,
1723
1719
RpcReqWifiSetBand , req_wifi_set_band ,
1724
1720
rpc__resp__wifi_set_band__init );
@@ -1731,10 +1727,14 @@ static esp_err_t req_wifi_set_band(Rpc *req, Rpc *resp, void *priv_data)
1731
1727
RPC_RET_FAIL_IF (esp_wifi_set_band (band ));
1732
1728
1733
1729
return ESP_OK ;
1730
+ #else
1731
+ return ESP_FAIL ;
1732
+ #endif
1734
1733
}
1735
1734
1736
1735
static esp_err_t req_wifi_get_band (Rpc * req , Rpc * resp , void * priv_data )
1737
1736
{
1737
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1738
1738
RPC_TEMPLATE_SIMPLE (RpcRespWifiGetBand , resp_wifi_get_band ,
1739
1739
RpcReqWifiGetBand , req_wifi_get_band ,
1740
1740
rpc__resp__wifi_get_band__init );
@@ -1747,10 +1747,14 @@ static esp_err_t req_wifi_get_band(Rpc *req, Rpc *resp, void *priv_data)
1747
1747
ESP_LOGW (TAG , "get band: %d" , band );
1748
1748
1749
1749
return ESP_OK ;
1750
+ #else
1751
+ return ESP_FAIL ;
1752
+ #endif
1750
1753
}
1751
1754
1752
1755
static esp_err_t req_wifi_set_band_mode (Rpc * req , Rpc * resp , void * priv_data )
1753
1756
{
1757
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1754
1758
RPC_TEMPLATE (RpcRespWifiSetBandMode , resp_wifi_set_bandmode ,
1755
1759
RpcReqWifiSetBandMode , req_wifi_set_bandmode ,
1756
1760
rpc__resp__wifi_set_band_mode__init );
@@ -1763,10 +1767,14 @@ static esp_err_t req_wifi_set_band_mode(Rpc *req, Rpc *resp, void *priv_data)
1763
1767
RPC_RET_FAIL_IF (esp_wifi_set_band_mode (band_mode ));
1764
1768
1765
1769
return ESP_OK ;
1770
+ #else
1771
+ return ESP_FAIL ;
1772
+ #endif
1766
1773
}
1767
1774
1768
1775
static esp_err_t req_wifi_get_band_mode (Rpc * req , Rpc * resp , void * priv_data )
1769
1776
{
1777
+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL (5 , 4 , 0 )
1770
1778
RPC_TEMPLATE_SIMPLE (RpcRespWifiGetBandMode , resp_wifi_get_bandmode ,
1771
1779
RpcReqWifiGetBandMode , req_wifi_get_bandmode ,
1772
1780
rpc__resp__wifi_get_band_mode__init );
@@ -1779,6 +1787,9 @@ static esp_err_t req_wifi_get_band_mode(Rpc *req, Rpc *resp, void *priv_data)
1779
1787
ESP_LOGW (TAG , "get band_mode: %d" , band_mode );
1780
1788
1781
1789
return ESP_OK ;
1790
+ #else
1791
+ return ESP_FAIL ;
1792
+ #endif
1782
1793
}
1783
1794
1784
1795
#if 0
0 commit comments