commit 6fbe6e4ac4811a03458900d46152010d412b5cfc Author: Morgan Allen Date: Sun Sep 2 17:10:41 2018 -0700 init skeleton commit diff --git a/Kconfig b/Kconfig new file mode 100644 index 0000000..a346c1f --- /dev/null +++ b/Kconfig @@ -0,0 +1,16 @@ +menuconfig WIFI_MANAGER_ENABLED + bool "WIFI_MANAGER" + default y + help + Select this option to enable WIFI_MANAGER driver and show the submodule with configuration + +config WIFI_MANAGER_MEM_ADDR + hex "Memory location to store AP info in flash" + depends on WIFI_MANAGER_ENABLED + default 0x04d000 + help + Memory location to store WiFi AP info + +config WIFI_MANAGER_MAX_AP + int "Maximum number of APs to store in flash" + default 8 diff --git a/Makefile.projbuild b/Makefile.projbuild new file mode 100644 index 0000000..cab9922 --- /dev/null +++ b/Makefile.projbuild @@ -0,0 +1,7 @@ +WIFI_MAN_BUILD_DIR=$(abspath $(BUILD_DIR_BASE)/wifi-manager) +WIFI_MAN_CONFIG_BIN=$(WIFI_MAN_BUILD_DIR)/wifi-manager-config.bin + +ESPTOOL_ALL_FLASH_ARGS += $(CONFIG_WIFI_MANAGER_MEM_ADDR) $(WIFI_MAN_CONFIG_BIN) + +wifi-man-flash-config: + echo flaaaaash diff --git a/component.mk b/component.mk new file mode 100644 index 0000000..9d7e185 --- /dev/null +++ b/component.mk @@ -0,0 +1,9 @@ +ifdef CONFIG_WIFI_MANAGER_ENABLED + +COMPONENT_SRCDIRS := main +COMPONENT_ADD_INCLUDEDIRS := main include +COMPONENT_ADD_LDFLAGS := -lesp32-wifi-manager + +COMPONENT_EXTRA_CLEAN := + +endif diff --git a/main/esp32-wifi-manager.c b/main/esp32-wifi-manager.c new file mode 100644 index 0000000..8f4d900 --- /dev/null +++ b/main/esp32-wifi-manager.c @@ -0,0 +1,31 @@ +#include + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#include "esp_log.h" +#include "esp_heap_caps.h" + +#include "driver/gpio.h" +#include "driver/spi_common.h" +#include "driver/spi_master.h" + +typedef struct wifi_man_ap_info { + +} wifi_man_ap_info_t; + +static struct wifi_man_ap_store { + uint8_t count; + + struct wifi_man_ap_info aps[CONFIG_WIFI_MANAGER_MAX_AP]; +} wifi_man_ap_store; + +void wifi_man_init_config() { + memset(&wifi_man_ap_store, 0, sizeof(struct wifi_man_ap_store)); +} + +int wifi_man_load_config() { + uint8_t count = 0; + + return count; +};