Skip to content

Commit 6fee36b

Browse files
committed
ready to test
1 parent 82b8f88 commit 6fee36b

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

subsystems/provisioning/definitions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ type Config struct {
372372
WifiPowerSave *bool `json:"wifi_power_save"`
373373

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

subsystems/provisioning/networkmanager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ func (w *Provisioning) getLastNetworkTried() NetworkInfo {
6565
}
6666

6767
func (w *Provisioning) checkOnline(force bool) error {
68+
if w.cfg.MDNSMode {
69+
return nil
70+
}
6871
if force {
6972
if err := w.nm.CheckConnectivity(); err != nil {
7073
w.logger.Error(err)

subsystems/provisioning/provisioning.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ func (w *Provisioning) init(ctx context.Context) error {
145145
w.mainLoopHealth.MarkGood()
146146
w.bgLoopHealth.MarkGood()
147147

148+
if w.cfg.MDNSMode {
149+
w.logger.Info("skipping networkmanager init because mdnsmode")
150+
return nil
151+
}
148152
nm, err := w.getNM()
149153
if err != nil {
150154
return err
@@ -386,6 +390,9 @@ func (w *Provisioning) updateHotspotSSID(cfg *Config) {
386390

387391
// must be run inside dataMu lock.
388392
func (w *Provisioning) writeWifiPowerSave(ctx context.Context) error {
393+
if w.cfg.MDNSMode {
394+
return nil
395+
}
389396
contents := wifiPowerSaveContentsDefault
390397
if w.cfg.WifiPowerSave != nil {
391398
if *w.cfg.WifiPowerSave {

0 commit comments

Comments
 (0)