Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/framework/APSettingsService.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include <DNSServer.h>
#include <IPAddress.h>

#define CHECK_LEN(s, min_len, max_len) \
static_assert(min_len <= sizeof(s) && sizeof(s) <= max_len, #s " should have " #min_len "-" #max_len " characters.")

#ifndef FACTORY_AP_PROVISION_MODE
#define FACTORY_AP_PROVISION_MODE AP_MODE_DISCONNECTED
#endif
Expand All @@ -17,10 +20,14 @@
#define FACTORY_AP_SSID "ESP8266-React-#{unique_id}"
#endif

CHECK_LEN(FACTORY_AP_SSID, 1, 64);

#ifndef FACTORY_AP_PASSWORD
#define FACTORY_AP_PASSWORD "esp-react"
#endif

CHECK_LEN(FACTORY_AP_PASSWORD, 8, 64);

#ifndef FACTORY_AP_LOCAL_IP
#define FACTORY_AP_LOCAL_IP "192.168.4.1"
#endif
Expand Down