undefined reference to `wifi_set_event_hander_cb'
Posted: Tue May 07, 2019 10:26 am
Has anyone gotten this code to work? Wifi_Set_Event_Hander_CB
*update* Turned out to be a typo on hander and not handler.. this is what I get for copying and pasting code =.=
Code: Select all
In file included from Main.c:3:0:
/home/osboxes/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/osapi.h:65:6: note: expected 'struct ETSTimer *' but argument is of type 'volatile struct ETSTimer *'
void ets_timer_arm_new(os_timer_t *ptimer, uint32_t time, bool repeat_flag, bool ms_flag);
^
xtensa-lx106-elf-gcc -Teagle.app.v6.ld Main.o -nostdlib -Wl,--start-group -lmain -lpwm -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -o Main
Main.o:(.irom0.literal+0x214): undefined reference to `wifi_set_event_hander_cb'
Main.o: In function `calculateCRC32':
Main.c:(.irom0.text+0x17f4): undefined reference to `wifi_set_event_hander_cb'
collect2: error: ld returned 1 exit status
make: *** [Main] Error 1
Code: Select all
void wifi_handle_event_cb(System_Event_t *evt)
{
os_printf("event %x\n", evt->event);
switch (evt->event)
{
case EVENT_STAMODE_CONNECTED:
os_printf("connect to ssid %s, channel %d\n",
evt->event_info.connected.ssid,
evt->event_info.connected.channel);
break;
case EVENT_STAMODE_DISCONNECTED:
os_printf("disconnect from ssid %s, reason %d\n",
evt->event_info.disconnected.ssid,
evt->event_info.disconnected.reason);
break;
case EVENT_STAMODE_AUTHMODE_CHANGE:
os_printf("mode: %d -> %d\n",
evt->event_info.auth_change.old_mode,
evt->event_info.auth_change.new_mode);
break;
case EVENT_STAMODE_GOT_IP:
os_printf("ip:" IPSTR ",mask:" IPSTR ",gw:" IPSTR,
IP2STR(&evt->event_info.got_ip.ip),
IP2STR(&evt->event_info.got_ip.mask),
IP2STR(&evt->event_info.got_ip.gw));
os_printf("\n");
break;
case EVENT_SOFTAPMODE_STACONNECTED:
os_printf("station: " MACSTR "join, AID = %d\n",
MAC2STR(evt->event_info.sta_connected.mac),
evt->event_info.sta_connected.aid);
break;
case EVENT_SOFTAPMODE_STADISCONNECTED:
os_printf("station: " MACSTR "leave, AID = %d\n", MAC2STR(evt->event_info.sta_disconnected.mac), evt->event_info.sta_disconnected.aid);
break;
default:
break;
}
}
wifi_set_event_hander_cb(wifi_handle_event_cb);
*update* Turned out to be a typo on hander and not handler.. this is what I get for copying and pasting code =.=