mb8600

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Copyright 2023 Thomas Helander

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultTimestamper

type DefaultTimestamper struct{}

func (*DefaultTimestamper) Timestamp

func (t *DefaultTimestamper) Timestamp() int64

type DownstreamChannel

type DownstreamChannel struct {
	Channel           int
	ChannelID         int
	LockStatus        string
	Modulation        string
	Frequency         float64
	Power             float64
	SignalToNoise     float64
	CorrectedErrors   float64
	UncorrectedErrors float64
}

func NewDownstreamChannelFromLine

func NewDownstreamChannelFromLine(line string) (*DownstreamChannel, error)

func NewDownstreamChannelsFromResponse

func NewDownstreamChannelsFromResponse(response string) ([]*DownstreamChannel, error)

func (*DownstreamChannel) Equal

Returns true if the channel has the same properties as channel o; false otherwise.

type MotoClient

type MotoClient struct {
	Address  string
	Username string
	Password string
	Logger   log.Logger
	// contains filtered or unexported fields
}

func NewMotoClient

func NewMotoClient(address, username, password string, logger log.Logger) *MotoClient

Returns a new client with the default Timestamper class.

The client will be configured to skip SSL certificate verification as the cable modem uses a self-signed certificate.

func NewMotoClientWithTimestamper

func NewMotoClientWithTimestamper(address, username, password string, logger log.Logger, timestamper Timestamper) *MotoClient

Returns a new client with the specified Timestamper class.

The client will be configured to skip SSL certificate verification as the cable modem uses a self-signed certificate.

func (*MotoClient) GetDownstreamChannels

func (c *MotoClient) GetDownstreamChannels() ([]*DownstreamChannel, error)

Returns a list of DownstreamChannel objects, or nil on an error.

func (*MotoClient) GetHNAPURI

func (c *MotoClient) GetHNAPURI() string

Returns the API endpoint URI as a string.

func (*MotoClient) GetHNAPURL

func (c *MotoClient) GetHNAPURL() (*url.URL, error)

Returns the API endpoint URI as a url.URL object.

func (*MotoClient) GetPrivateKey

func (c *MotoClient) GetPrivateKey() (string, error)

Return the private key used for communicating with the modem, or the default private key value used when logging in.

func (*MotoClient) GetUID

func (c *MotoClient) GetUID() (string, error)

Return the client UID.

func (*MotoClient) GetUpstreamChannels

func (c *MotoClient) GetUpstreamChannels() ([]*UpstreamChannel, error)

Returns a list of UpstreamChannel objects, or nil on an error.

func (*MotoClient) Login

func (c *MotoClient) Login() (map[string]string, error)

Logs in to the modem using the client credentials.

Returns the login response if the login was successful, or an nil map and an error on a login failure.

func (*MotoClient) SetPrivateKey

func (c *MotoClient) SetPrivateKey(key string) error

Set the private key.

func (*MotoClient) SetUID

func (c *MotoClient) SetUID(uid string) error

Set the client UID.

type Timestamper

type Timestamper interface {
	Timestamp() int64
}

type UpstreamChannel

type UpstreamChannel struct {
	Channel     int
	ChannelID   int
	LockStatus  string
	ChannelType string
	SymbolRate  float64
	Frequency   float64
	Power       float64
}

func NewUpstreamChannelFromLine

func NewUpstreamChannelFromLine(line string) (*UpstreamChannel, error)

func NewUpstreamChannelsFromResponse

func NewUpstreamChannelsFromResponse(response string) ([]*UpstreamChannel, error)

func (*UpstreamChannel) Equal

func (c *UpstreamChannel) Equal(o *UpstreamChannel) bool

Returns true if the channel has the same properties as channel o; false otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL