Skip to content

Commit

Permalink
feat: allow connecting to one specific server IP without broadcasting (
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV authored Jan 19, 2024
1 parent 35da44b commit 2c8e41c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
10 changes: 10 additions & 0 deletions src/network/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2c8e41c

Please sign in to comment.