Page 1 of 1

Return of esp_wifi_internal_tx not declared

Posted: Sat Jul 29, 2017 12:31 pm
by Staubgeborener
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;
    }
}

Re: Return of esp_wifi_internal_tx not declared

Posted: Sat Jul 29, 2017 12:49 pm
by WiFive
Not sure if it is actually using lwip error codes or if it is using esp_WiFi error codes and the names are wrong.

Re: Return of esp_wifi_internal_tx not declared

Posted: Sun Jul 30, 2017 6:38 am
by ESP_igrr
This function returns LwIP error codes which are normally passed to lower layers of LwIP.