From 5e3503b497ddfb2323f88e93031c30e1f38efeb4 Mon Sep 17 00:00:00 2001 From: mattbk Date: Mon, 25 Sep 2023 21:53:20 -0500 Subject: [PATCH] Use integer network setting to avoid string comparison. --- vulpes/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index dccfb67..2a36174 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -34,8 +34,8 @@ const int blinker = LED_BUILTIN; RTC_DS3231 rtc; // set up RTC const int alarmPin = 4; // pin to monitor for RTC alarms -// Network options: "wifi" for existing netowrk, "ap" to be an access point -const char* network = "ap"; +// Network options: "0" for existing netowrk, "1" to be an access point +const int network = 1; // Connect to existing network // Read from config.h const char* ssid = WIFI_SSID; @@ -358,7 +358,7 @@ void setup() { } WiFi.setHostname("vulpes"); - if (network == "wifi"){ + if (network == 0){ // Attach to existing wifi WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); @@ -369,7 +369,7 @@ void setup() { Serial.println(); Serial.print("IP Address: "); Serial.println(WiFi.localIP()); - } else if (network == "ap"){ + } else if (network == 1){ // Act as new access point WiFi.softAPConfig(local_ip, gateway, subnet); WiFi.softAP(ssid_ap, password_ap);