feat(ModemAuthentication): add pin, GetModemAuthentication #4
@@ -222,4 +222,19 @@ func (c *Client) GetModemConfiguration(ctx context.Context) (any, error) {
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// GetModemConfiguration implements protocol.Operations.
|
||||
func (c *Client) GetModemAuthentication(ctx context.Context) (any, error) {
|
||||
_, ops, err := c.getProtocol(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
config, err := ops.GetModemAuthentication(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
var _ protocol.Operations = &Client{}
|
||||
|
@@ -64,4 +64,7 @@ type Operations interface {
|
||||
|
||||
//GetModemConfiguration mobile data config
|
||||
GetModemConfiguration(ctx context.Context) (any, error)
|
||||
|
||||
//GetModemAuthentication mobile data config
|
||||
GetModemAuthentication(ctx context.Context) (any, error)
|
||||
}
|
||||
|
@@ -400,4 +400,9 @@ func (o *Operations) GetModemConfiguration(ctx context.Context) (any, error) {
|
||||
return nil, protocol.ErrUnimplemented
|
||||
}
|
||||
|
||||
// Deprecated : is no longer maintained for modules in V1
|
||||
func (o *Operations) GetModemAuthentication(ctx context.Context) (any, error) {
|
||||
return nil, protocol.ErrUnimplemented
|
||||
}
|
||||
|
||||
var _ protocol.Operations = &Operations{}
|
||||
|
@@ -174,7 +174,7 @@ func (o *Operations) PostModem(ctx context.Context, config *model.ModemAuthentic
|
||||
return &updated, nil
|
||||
}
|
||||
|
||||
func (o *Operations) GetModem(ctx context.Context) (*model.ModemConfiguration, error) {
|
||||
func (o *Operations) GetModemInfo(ctx context.Context) (*model.ModemConfiguration, error) {
|
||||
config := &model.ModemConfiguration{}
|
||||
|
||||
if err := o.GetJSON("/modem/1/info", config); err != nil {
|
||||
@@ -183,3 +183,13 @@ func (o *Operations) GetModem(ctx context.Context) (*model.ModemConfiguration, e
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
func (o *Operations) GetModemSettings(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
|
||||
}
|
||||
|
@@ -397,9 +397,20 @@ func (o *Operations) SetModem(ctx context.Context, funcs ...protocol.SetModemOpt
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetModem implements protocol.Operations.
|
||||
// GetModem implements protocol.Operations.
|
||||
func (o *Operations) GetModemConfiguration(ctx context.Context) (any, error) {
|
||||
config, err := o.GetModem(ctx)
|
||||
config, err := o.GetModemInfo(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
||||
return config, nil
|
||||
|
||||
}
|
||||
|
||||
// GetModemSettings implements protocol.Operations.
|
||||
func (o *Operations) GetModemAuthentication(ctx context.Context) (any, error) {
|
||||
config, err := o.GetModemSettings(ctx)
|
||||
if err != nil {
|
||||
return nil, errors.WithStack(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user