Skip to content

Commit

Permalink
Add back dwell after configuration for the Linksys AP.
Browse files Browse the repository at this point in the history
  • Loading branch information
jschenke488 committed Oct 29, 2024
1 parent ebdf9a6 commit aa8eec3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions network/access_point.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const (
accessPointPollPeriodSec = 3
accessPointRequestBufferSize = 10
accessPointConfigRetryIntervalSec = 30
accessPointConfigBackoffSec = 5
)

type AccessPoint struct {
Expand Down Expand Up @@ -161,6 +162,11 @@ func (ap *AccessPoint) configureTeams(teams [6]*model.Team) {

_, _ = ap.runCommand("uci commit wireless")
_, _ = ap.runCommand("wifi reload")
if !ap.isVividType {
// The Linksys AP returns immediately after 'wifi reload' but may not have applied the configuration yet;
// sleep for a bit to compensate. (The Vivid AP waits for the configuration to be applied before returning.)
time.Sleep(time.Second * accessPointConfigBackoffSec)
}
err := ap.updateTeamWifiStatuses()
if err == nil && ap.configIsCorrectForTeams(teams) {
log.Printf("Successfully configured WiFi after %d attempts.", retryCount)
Expand Down

0 comments on commit aa8eec3

Please sign in to comment.