Documentation
¶
Overview ¶
Package tmhi provides gateway communication for TMHI modems.
Index ¶
- Variables
- func NewAuthError(status int, message string) error
- func NewGatewayError(op string, status int, message string, err error) error
- type ArcadyanGateway
- func (a *ArcadyanGateway) Info(ctx context.Context) (*InfoResult, error)
- func (a *ArcadyanGateway) Login(ctx context.Context) error
- func (a *ArcadyanGateway) Reboot(ctx context.Context) error
- func (a *ArcadyanGateway) Request(ctx context.Context, method, path string) (*InfoResult, error)
- func (a *ArcadyanGateway) Signal(ctx context.Context) (*SignalResult, error)
- func (a *ArcadyanGateway) Status(ctx context.Context) (*StatusResult, error)
- type AuthenticationError
- type FiveGSignal
- type FourGSignal
- type Gateway
- type GatewayCommon
- type GatewayConfig
- type GatewayError
- type GenericSignalInfo
- type InfoResult
- type NokiaGateway
- func (*NokiaGateway) Info(_ context.Context) (*InfoResult, error)
- func (n *NokiaGateway) Login(ctx context.Context) error
- func (n *NokiaGateway) Reboot(ctx context.Context) error
- func (*NokiaGateway) Request(_ context.Context, _, _ string) (*InfoResult, error)
- func (*NokiaGateway) Signal(_ context.Context) (*SignalResult, error)
- func (n *NokiaGateway) Status(ctx context.Context) (*StatusResult, error)
- type SignalData
- type SignalResult
- type StatusResult
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAuthentication indicates an authentication failure. ErrAuthentication = errors.New("could not authenticate") // ErrNotImplemented indicates an unsupported operation. ErrNotImplemented = errors.New("command not implemented") // ErrRebootFailed indicates a reboot operation failed. ErrRebootFailed = errors.New("reboot failed") // ErrSignalFailed indicates a signal operation failed. ErrSignalFailed = errors.New("signal failed") )
Sentinel errors for gateway operations.
Functions ¶
func NewAuthError ¶
NewAuthError creates a new AuthenticationError.
Types ¶
type ArcadyanGateway ¶
type ArcadyanGateway struct {
*GatewayCommon
// contains filtered or unexported fields
}
ArcadyanGateway implements Gateway for Arcadyan-based T-Mobile gateways.
func NewArcadyanGateway ¶
func NewArcadyanGateway(cfg *GatewayConfig) *ArcadyanGateway
NewArcadyanGateway creates a new Arcadyan gateway instance.
func (*ArcadyanGateway) Info ¶
func (a *ArcadyanGateway) Info(ctx context.Context) (*InfoResult, error)
Info retrieves gateway information.
func (*ArcadyanGateway) Login ¶
func (a *ArcadyanGateway) Login(ctx context.Context) error
Login authenticates with the Arcadyan gateway.
func (*ArcadyanGateway) Reboot ¶
func (a *ArcadyanGateway) Reboot(ctx context.Context) error
Reboot restarts the Arcadyan gateway.
func (*ArcadyanGateway) Request ¶
func (a *ArcadyanGateway) Request(ctx context.Context, method, path string) (*InfoResult, error)
Request makes an HTTP request to the gateway.
func (*ArcadyanGateway) Signal ¶
func (a *ArcadyanGateway) Signal(ctx context.Context) (*SignalResult, error)
Signal retrieves signal strength information.
func (*ArcadyanGateway) Status ¶
func (a *ArcadyanGateway) Status(ctx context.Context) (*StatusResult, error)
Status checks the gateway connection status.
type AuthenticationError ¶
AuthenticationError represents an authentication failure with the gateway.
func (*AuthenticationError) Error ¶
func (e *AuthenticationError) Error() string
func (*AuthenticationError) Is ¶
func (*AuthenticationError) Is(target error) bool
Is checks if the target error matches ErrAuthentication.
func (*AuthenticationError) Unwrap ¶
func (*AuthenticationError) Unwrap() error
type FiveGSignal ¶
type FiveGSignal struct {
SignalData
AntennaUsed string
GNBID int
}
FiveGSignal contains 5G signal information.
type FourGSignal ¶
type FourGSignal struct {
SignalData
ENBID int
}
FourGSignal contains 4G signal information.
type Gateway ¶
type Gateway interface {
Login(ctx context.Context) error
Reboot(ctx context.Context) error
Request(ctx context.Context, method, path string) (*InfoResult, error)
Info(ctx context.Context) (*InfoResult, error)
Status(ctx context.Context) (*StatusResult, error)
Signal(ctx context.Context) (*SignalResult, error)
}
Gateway defines the interface for T-Mobile gateway implementations.
type GatewayCommon ¶
type GatewayCommon struct {
// contains filtered or unexported fields
}
GatewayCommon provides shared functionality for gateway implementations.
func NewGatewayCommon ¶
func NewGatewayCommon(cfg *GatewayConfig) *GatewayCommon
NewGatewayCommon creates a new GatewayCommon with the given configuration.
func (*GatewayCommon) CheckWebInterface ¶
func (gc *GatewayCommon) CheckWebInterface(ctx context.Context) *StatusResult
CheckWebInterface checks if the gateway web interface is accessible.
type GatewayConfig ¶
type GatewayConfig struct {
IP string
Username string
Password string
Timeout time.Duration
Retries int
DryRun bool
Debug bool
}
GatewayConfig holds configuration values needed for gateway client operations.
type GatewayError ¶
GatewayError represents a gateway operation failure.
func (*GatewayError) Error ¶
func (e *GatewayError) Error() string
func (*GatewayError) Unwrap ¶
func (e *GatewayError) Unwrap() error
type GenericSignalInfo ¶
GenericSignalInfo contains generic signal information.
type InfoResult ¶
InfoResult contains gateway information response.
func (*InfoResult) String ¶
func (r *InfoResult) String() string
type NokiaGateway ¶
type NokiaGateway struct {
*GatewayCommon
// contains filtered or unexported fields
}
NokiaGateway implements Gateway for Nokia-based T-Mobile gateways.
func NewNokiaGateway ¶
func NewNokiaGateway(cfg *GatewayConfig) *NokiaGateway
NewNokiaGateway creates a new Nokia gateway instance.
func (*NokiaGateway) Info ¶
func (*NokiaGateway) Info(_ context.Context) (*InfoResult, error)
Info is not implemented for Nokia gateway.
func (*NokiaGateway) Login ¶
func (n *NokiaGateway) Login(ctx context.Context) error
Login authenticates with the Nokia gateway.
func (*NokiaGateway) Reboot ¶
func (n *NokiaGateway) Reboot(ctx context.Context) error
Reboot restarts the Nokia gateway.
func (*NokiaGateway) Request ¶
func (*NokiaGateway) Request(_ context.Context, _, _ string) (*InfoResult, error)
Request is not implemented for Nokia gateway.
func (*NokiaGateway) Signal ¶
func (*NokiaGateway) Signal(_ context.Context) (*SignalResult, error)
Signal is not implemented for Nokia gateway.
func (*NokiaGateway) Status ¶
func (n *NokiaGateway) Status(ctx context.Context) (*StatusResult, error)
Status checks the gateway connection status.
type SignalData ¶
SignalData contains signal metrics.
type SignalResult ¶
type SignalResult struct {
FourG *FourGSignal
FiveG *FiveGSignal
Generic GenericSignalInfo
}
SignalResult contains complete signal information.