@@ -91,6 +91,9 @@ type RPCState struct {
9191// HwRebootFunc is a function that reboots the hardware
9292type HwRebootFunc func (force bool , postRebootAction * PostRebootAction , delay time.Duration ) error
9393
94+ // ResetConfigFunc is a function that resets the config
95+ type ResetConfigFunc func () error
96+
9497// GetHTTPClientFunc is a function that returns the HTTP client
9598type GetHTTPClientFunc func () * http.Client
9699
@@ -117,6 +120,7 @@ type State struct {
117120 reboot HwRebootFunc
118121 getLocalVersion GetLocalVersionFunc
119122 onStateUpdate OnStateUpdateFunc
123+ resetConfig ResetConfigFunc
120124}
121125
122126// SetTargetVersion sets the target version for a component
@@ -199,6 +203,7 @@ type Options struct {
199203 OnProgressUpdate OnProgressUpdateFunc
200204 HwReboot HwRebootFunc
201205 ReleaseAPIEndpoint string
206+ ResetConfig ResetConfigFunc
202207}
203208
204209// NewState creates a new OTA state
@@ -215,6 +220,7 @@ func NewState(opts Options) *State {
215220 getLocalVersion : opts .GetLocalVersion ,
216221 componentUpdateStatuses : components ,
217222 releaseAPIEndpoint : opts .ReleaseAPIEndpoint ,
223+ resetConfig : opts .ResetConfig ,
218224 }
219225 go s .confirmCurrentSystem ()
220226 return s
0 commit comments