diff --git a/platformio.ini b/platformio.ini index 01e6fdd65..bf3ac8ec6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -35,6 +35,9 @@ build_flags = ; -DWIFI_STATIC_GATEWAY=192,168,XXX,XXX ; -DWIFI_STATIC_SUBNET=255,255,255,0 +; -DSERVER_IP='"192.168.XXX.XXX"' +; -DSERVER_PORT=6969 + ; Uncomment below if your board are using 40MHz crystal instead of 26MHz for ESP8266 ; -DF_CRYSTAL=40000000 @@ -93,7 +96,7 @@ upload_speed = 921600 ;[env:esp32c3] ;platform = espressif32 @ 6.1.0 -;build_flags = +;build_flags = ; ${env.build_flags} ; -DESP32C3 ;board = lolin_c3_mini diff --git a/src/network/connection.h b/src/network/connection.h index 1231ee247..7b8f7b6a2 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -37,6 +37,16 @@ namespace Network { class Connection { public: + Connection() { +#ifdef SERVER_IP + m_ServerHost.fromString(SERVER_IP); +#endif + +#ifdef SERVER_PORT + m_ServerPort = SERVER_PORT; +#endif + } + void searchForServer(); void update(); void reset();