Skip to content

Commit d5f9d0b

Browse files
fix(sniffer): select correct interface
1 parent f195e3f commit d5f9d0b

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

backend/cmd/config.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# Control Station general configuration
55
[app]
66
addr = "0.0.0.0:80" # Where app will listen for incoming connections
7+
hypervisor_addr = "192.168.0.23" # IP address of the Hypervisor (where the backend will send commands and receive telemetry data)
78
static_path = "./frontend/dist" # Path to the frontend static files (relative to the backend/cmd directory)
89

910
# Vehicle Configuration
1011
[vehicle]
11-
boards = [ "HVSCU"]
12+
boards = [ "LCU" , "HVBMS"]
1213

1314
# ADJ (Architecture Description JSON) Configuration
1415
[adj]

backend/cmd/dev-config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Control Station general configuration
55
[app]
66
addr = "0.0.0.0:80" # Where app will listen for incoming connections
7+
hypervisor_addr = "192.168.0.23" # IP address of the Hypervisor (where the backend will send commands and receive telemetry data)
78
static_path = "./frontend/dist" # Path to the frontend static files (relative to the backend/cmd directory)
89

910
# Vehicle Configuration

backend/cmd/setup_sniffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func selectDev(adjAddr map[string]string, conf config.Config) (pcap.Interface, e
7676

7777
for _, dev := range devs {
7878
for _, addr := range dev.Addresses {
79-
if addr.IP.String() == adjAddr["backend"] {
79+
if addr.IP.String() == conf.App.HypervisorAddr {
8080
return dev, nil
8181
}
8282
}

backend/internal/config/config_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
)
66

77
type App struct {
8-
Addr string `toml:"addr"`
9-
StaticPath string `toml:"static_path"`
8+
Addr string `toml:"addr"`
9+
StaticPath string `toml:"static_path"`
10+
HypervisorAddr string `toml:"hypervisor_addr"`
1011
}
1112

1213
type Adj struct {

0 commit comments

Comments
 (0)