Skip to content

Commit

Permalink
ready to test
Browse files Browse the repository at this point in the history
  • Loading branch information
abe-winter committed Dec 16, 2024
1 parent 82b8f88 commit 6fee36b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions subsystems/provisioning/definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ type Config struct {
WifiPowerSave *bool `json:"wifi_power_save"`

// When true, advertise via mdns on pre-existing network instead of using static IP and captive portal.
// (Instead of the default behavior of starting a captive portal).
MDNSMode bool `json:"mdns_mode"`
}

Expand Down
3 changes: 3 additions & 0 deletions subsystems/provisioning/networkmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ func (w *Provisioning) getLastNetworkTried() NetworkInfo {
}

func (w *Provisioning) checkOnline(force bool) error {
if w.cfg.MDNSMode {
return nil
}
if force {
if err := w.nm.CheckConnectivity(); err != nil {
w.logger.Error(err)
Expand Down
7 changes: 7 additions & 0 deletions subsystems/provisioning/provisioning.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ func (w *Provisioning) init(ctx context.Context) error {
w.mainLoopHealth.MarkGood()
w.bgLoopHealth.MarkGood()

if w.cfg.MDNSMode {
w.logger.Info("skipping networkmanager init because mdnsmode")
return nil
}
nm, err := w.getNM()
if err != nil {
return err
Expand Down Expand Up @@ -386,6 +390,9 @@ func (w *Provisioning) updateHotspotSSID(cfg *Config) {

// must be run inside dataMu lock.
func (w *Provisioning) writeWifiPowerSave(ctx context.Context) error {
if w.cfg.MDNSMode {
return nil
}
contents := wifiPowerSaveContentsDefault
if w.cfg.WifiPowerSave != nil {
if *w.cfg.WifiPowerSave {
Expand Down

0 comments on commit 6fee36b

Please sign in to comment.