feat(reachview): GetModemConfiguration func

This commit is contained in:
2025-07-04 14:45:36 +02:00
parent 1fcf748310
commit c9c6115bf3
8 changed files with 115 additions and 17 deletions

View File

@ -173,3 +173,13 @@ func (o *Operations) PostModem(ctx context.Context, config *model.ModemAuthentic
return &updated, nil
}
func (o *Operations) GetModem(ctx context.Context) (*model.ModemAuthentication, error) {
config := &model.ModemAuthentication{}
if err := o.GetJSON("/modem/1/settings", config); err != nil {
return nil, errors.WithStack(err)
}
return config, nil
}

View File

@ -2,5 +2,5 @@ package model
type Action struct {
Name string `json:"name"`
Paylaod map[string]any `json:"payload"`
Paylaod map[string]any `json:"payload,omitempty"`
}

View File

@ -399,4 +399,15 @@ func (o *Operations) SetModem(ctx context.Context, funcs ...protocol.SetModemOpt
return nil
}
// SetModem implements protocol.Operations.
func (o *Operations) GetModemConfiguration(ctx context.Context) (any, error) {
config, err := o.GetModem(ctx)
if err != nil {
return nil, errors.WithStack(err)
}
return config, nil
}
var _ protocol.Operations = &Operations{}