Skip to content

Commit

Permalink
Add more logging to modemd
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronRP committed Mar 26, 2024
1 parent cd28ab9 commit 66c684f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/modemd/modemController.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,13 @@ func setUSBPower(enabled bool) error {
cmd := exec.Command("bash", "-c", command)
err := cmd.Run()
if err != nil {
return fmt.Errorf("failed to set USB power: %w", err)
enDis := "disable"
if enabled {
enDis = "enable"
}
return fmt.Errorf("failed to %s USB power: %w, command: %s", enDis, err, command)
}
time.Sleep(100 * time.Millisecond) // Need to wait or or else disabling ethernet might not work.
time.Sleep(500 * time.Millisecond) // Need to wait or or else disabling ethernet might not work.
}
return nil
}
Expand Down

0 comments on commit 66c684f

Please sign in to comment.