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
VOLCA2333 committed Feb 19, 2024
1 parent 35da44b commit 8bf6ad3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 7 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
; See docs for configuration options and examples:
; https://docs.slimevr.dev/firmware/configuring-project.html#1-configuring-platformioini
; ================================================

;
[env]
lib_deps=
https://github.com/SlimeVR/CmdParser.git
Expand All @@ -26,15 +26,18 @@ build_flags =
;If you want to set hardcoded WiFi SSID and password, uncomment and edit the lines below
;To uncomment, only remove ";" and leave the two spaces in front of the tags
; '" - quotes are necessary!
; -DWIFI_CREDS_SSID='"SSID"'
; -DWIFI_CREDS_PASSWD='"PASSWORD"'
-DWIFI_CREDS_SSID='"TP-LINK_9527"'
-DWIFI_CREDS_PASSWD='"1414@1414"'

;If you want to set a static IP address, uncomment and edit the lines below
; -DWIFI_USE_STATICIP
; -DWIFI_STATIC_IP=192,168,XXX,XXX
; -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 8bf6ad3

Please sign in to comment.