Added wifi component

This commit is contained in:
Brian Campuzano 2017-02-20 22:48:56 -08:00
parent 492561e0df
commit 6e8b650663
4 changed files with 29 additions and 0 deletions

View File

View File

@ -0,0 +1,25 @@
#include "esp_wifi.h"
#include "limbo_wifi.h"
#include "skynet.h"
void limbo_wifi_init(void)
{
tcpip_adapter_init();
ESP_ERROR_CHECK( esp_event_loop_init(event_handler, NULL) );
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK( esp_wifi_init(&cfg) );
ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) );
ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) );
wifi_config_t sta_config = {
.sta = {
.ssid = LIMBO_SSID,
.password = LIMBO_PASSWORD,
.bssid_set = false
}
};
ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &sta_config) );
ESP_ERROR_CHECK( esp_wifi_start() );
ESP_ERROR_CHECK( esp_wifi_connect() );
}

View File

@ -0,0 +1,4 @@
// Initializes wifi settings for project
void limbo_wifi_init(void);