Return of esp_wifi_internal_tx not declared

Staubgeborener
Posts: 20
Joined: Sat Jul 22, 2017 11:59 am

Return of esp_wifi_internal_tx not declared

Postby Staubgeborener » Sat Jul 29, 2017 12:31 pm

I want to use esp_wifi_internal_tx for sending some packets with the esp-idf v2.1. But everytime i want to get a return of the function, i'll get this error message:
error: 'ERR_OK' was not declared in this scope
case ERR_OK:
^
error: 'ERR_IF' was not declared in this scope
case ERR_IF:
^

Code: Select all

//building packet here
esp_wifi_internal_tx(wifi_if, (void*)packet, sizeof(packet));
        send_packet(wifi_if, (void*)packet, sizeof(packet));

void send_packet(esp_interface_t iface, void* buf, uint8_t len)
{
    printf("Sending packet\n");
    switch(esp_wifi_internal_tx(iface, buf, len))
    {
        case ERR_OK:
            printf("Successfully transmit the buffer to wifi driver\n");
            break;
        case ERR_IF:
            printf("WiFi driver error\n");
            break;
         case ERR_MEM:
            printf("Out of memory\n");
            break;
         case ERR_ARG:
            printf("Invalid argument\n");
            break;
        default:
            printf("Some other error I don't want to control now\n");
            break;
    }
}

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Return of esp_wifi_internal_tx not declared

Postby WiFive » Sat Jul 29, 2017 12:49 pm

Not sure if it is actually using lwip error codes or if it is using esp_WiFi error codes and the names are wrong.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Return of esp_wifi_internal_tx not declared

Postby ESP_igrr » Sun Jul 30, 2017 6:38 am

This function returns LwIP error codes which are normally passed to lower layers of LwIP.

Who is online

Users browsing this forum: No registered users and 142 guests