Return of esp_wifi_internal_tx not declared
Posted: 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;
}
}