From bd15b524fb7617ee26f406e71804b76a42c7cf13 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Wed, 5 Jun 2024 19:00:15 -0400 Subject: [PATCH] Started adding Wireguard support --- src/main.ino | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.ino b/src/main.ino index 30a7ac8..7e7b580 100644 --- a/src/main.ino +++ b/src/main.ino @@ -12,6 +12,7 @@ #include #include #include +#include // Local includes #include "bootScreen.h" @@ -81,6 +82,9 @@ bool readyToJoinChannel = false; bool screenOn = true; int selectedNetworkIndex = 0; +static WireGuard wg; + + // Main functions --------------------------------------------------------------------------------- void displayXBM() { @@ -110,6 +114,13 @@ void displayXBM() { } +void wgConnect(const IPAddress& localIp, const char* privateKey, const char* endpointAddress, const char* publicKey, uint16_t endpointPort) { + //IPAddress localIp(192, 168, 1, 100); + //IPAddress endpointIp(192, 168, 1, 1); + wg.begin(localIp, privateKey, endpointAddress, publicKey, endpointPort); +} + + void setup() { // Initialize serial communication Serial.begin(115200); @@ -830,7 +841,7 @@ void turnOnScreen() { void updateTimeFromNTP() { Serial.println("Syncing time with NTP server..."); - configTime(-5 * 3600, 0, "pool.ntp.org", "time.nist.gov"); + configTime(-5 * 3600, 3600, "pool.ntp.org", "north-america.pool.ntp.org", "time.nist.gov"); for (int i = 0; i < 10; ++i) { // Try up to 10 times delay(2000);