Page 1 of 1

enum wifi_bandwidth_t not complete

Posted: Thu Dec 22, 2016 8:29 pm
by SpenZerX
Hi,

esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw);


wifi_bandwidth_t sta_wifi_bandwidth;
esp_wifi_get_bandwidth(WIFI_IF_STA, &sta_wifi_bandwidth);
printf("debug: value is %u"
,sta_wifi_bandwidth);

result-> debug: value is 2
same for AP_IF

typedef enum {
WIFI_BW_HT20 = 0, /* Bandwidth is HT20 */
WIFI_BW_HT40, /* Bandwidth is HT40 */
WIFI_???????, /* enum for value 2 is missing */
} wifi_bandwidth_t;

Re: enum wifi_bandwidth_t not complete

Posted: Fri Dec 23, 2016 3:34 am
by WiFive
Maybe it is a bit field instead of an enum?

Re: enum wifi_bandwidth_t not complete

Posted: Sun Jan 01, 2017 9:06 pm
by jkvarela
This feature is not working to me.

to:

printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_STA, WIFI_BW_HT20));
printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_AP , WIFI_BW_HT20));

or to:

printf("Band :%X\r\n",esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20));
printf("Band :%X\r\n",esp_wifi_set_bandwidth(WIFI_IF_AP , WIFI_BW_HT20));

the answer is:

Band :102

Band :102

that means:

ESP_ERR_WIFI_ARG

I put this code after and before esp_wifi_start() like this:

//--------------------------------------------------------------
printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_STA, WIFI_BW_HT20));
printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_AP , WIFI_BW_HT20));

ESP_ERROR_CHECK( esp_wifi_start() );

printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_STA, WIFI_BW_HT20));
printf("Band :%X\r\n",esp_wifi_set_bandwidth(ESP_IF_WIFI_AP , WIFI_BW_HT20));

Anyone get this feature work?

Tks;

Juliano

Re: enum wifi_bandwidth_t not complete

Posted: Wed Jan 04, 2017 12:42 am
by ESP_igrr
This enum is not declared correctly, HT20 should be 1 and HT40 should be 2. Fix is coming up.