Login
1 branch 0 tags
Ben (Desktop/Arch) Wifi/Podcasts on the ESP32!!!! 90acdde 1 month ago 77 Commits
moon / src / config.h
#pragma once
#include <stdbool.h>

// Config file format (Onigiri/config.toml):
//
//   [[wifi]]
//   ssid = "MyNetwork"
//   psk = "MyPassword"
//
//   [[wifi]]
//   ssid = "AnotherNetwork"
//   psk = "AnotherPassword"
//
#define CONFIG_FILE "Onigiri/config.toml"
#define CONFIG_MAX_WIFI 8

typedef struct {
	char ssid[33];
	char psk[64];
} wifi_config_entry_t;

typedef struct {
	wifi_config_entry_t wifi[CONFIG_MAX_WIFI];
	int wifi_count;
} config_t;

// Load config from CONFIG_FILE on storage
// Returns true on success
bool config_load(config_t* cfg);