Added the ESP-wifi-config submodule to the ESP-RTOS and also add a example
This commit is contained in:
parent
c97ef10267
commit
e7a95326d3
4 changed files with 41 additions and 0 deletions
19
examples/wifi-config-v2/main.c
Normal file
19
examples/wifi-config-v2/main.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include <esp/uart.h>
|
||||
|
||||
#include "wifi_config.h"
|
||||
|
||||
|
||||
void on_wifi_event(wifi_config_event_t event) {
|
||||
if (event == WIFI_CONFIG_CONNECTED) {
|
||||
printf("Connected to WiFi\n");
|
||||
} else if (event == WIFI_CONFIG_DISCONNECTED) {
|
||||
printf("Disconnected from WiFi\n");
|
||||
}
|
||||
}
|
||||
|
||||
void user_init(void) {
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
wifi_config_init2("my-accessory", NULL, on_wifi_event);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue