diff --git a/Project/applications/smartcities/callbacks.c b/Project/applications/smartcities/callbacks.c new file mode 100644 index 0000000..c44fee6 --- /dev/null +++ b/Project/applications/smartcities/callbacks.c @@ -0,0 +1,25 @@ +#include "callbacks.h" + +void dhcp_connect_result_cb(int result) +{ + libwismart_ip_addr_t ip; + if(result==LIBWISMART_DHCP_ADDRESS_ASSIGNED) + { + libwismart_GetCurrentIP(&ip,NULL,NULL); + printf("IP: %d.%d.%d.%d \r\n",ip.addr[3],ip.addr[2],ip.addr[1],ip.addr[0]); + } + else if(result==LIBWISMART_DHCP_TIMEOUT) + { + printf("DHCP timeout\r\n"); + } + else + { + printf("DHCP error\r\n"); + } + +} + +void wifi_connect_result_cb(int result) +{ + printf("WiFi Connect indication: %s\r\n", (result == WISMART_WIFI_CONNECTED) ? "Connected": "Failed\r\n"); +} \ No newline at end of file diff --git a/Project/applications/smartcities/include/callbacks.h b/Project/applications/smartcities/include/callbacks.h new file mode 100644 index 0000000..b3d2b21 --- /dev/null +++ b/Project/applications/smartcities/include/callbacks.h @@ -0,0 +1,9 @@ +#ifndef MODULE_H +#define MODULE_H + +#include "libwismart.h" + +void dhcp_connect_result_cb(int result); +void wifi_connect_result_cb(int result); + +#endif \ No newline at end of file