Documentation ¶
Index ¶
- Constants
- type CarrierProfile
- type Mode
- type Modem
- func (m *Modem) Cmd(cmd string) (string, error)
- func (m *Modem) Configure() error
- func (m *Modem) GetInfo() (ret ModemInfo, err error)
- func (m *Modem) GetSettings() (ret ModemSettings, err error)
- func (m *Modem) GetState() (ret ModemState, err error)
- func (m *Modem) HTTPGet(urlIn string) ([]byte, error)
- func (m *Modem) Reset() error
- func (m *Modem) SetAPN() error
- func (m *Modem) SetCarrierProfile(profile CarrierProfile) error
- func (m *Modem) SetMode(mode Mode) error
- func (m *Modem) SetTechnology(tech Technology) error
- func (m *Modem) SwitchCmdMode() error
- func (m *Modem) Write() error
- type ModemInfo
- type ModemManager
- type ModemSettings
- type ModemState
- type State
- type Technology
Constants ¶
const ( CarrierProfileAuto CarrierProfile = 0 CarrierProfileNone = 1 CarrierProfileATT = 2 CarrierProfileVerizon = 3 )
define value carrier profiles
const ( TechnologyLTEMWithNBIOTFallback Technology = 0 TechnologyNBIOTWithLTEMFallback = 1 TechnologyLTEM = 2 TechnologyNBIOT = 3 )
define valid technologies
const ( ModeTransparent Mode = 0 ModeAPI = 1 ModeAPIWithEscape = 2 ModePython = 4 ModeBypass = 5 )
define valid modes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CarrierProfile ¶
type CarrierProfile int
CarrierProfile is used to lock modem to a particular carrier
func (CarrierProfile) String ¶
func (cp CarrierProfile) String() string
type Modem ¶
type Modem struct {
// contains filtered or unexported fields
}
Modem is a typethat defines a modem
func NewModem ¶
func NewModem(port io.ReadWriter, apn string, debug bool) *Modem
NewModem creates a new modem type
port should be a respreader
func (*Modem) GetSettings ¶
func (m *Modem) GetSettings() (ret ModemSettings, err error)
GetSettings are used to fetch the modem settings
func (*Modem) GetState ¶
func (m *Modem) GetState() (ret ModemState, err error)
GetState is used to return modem state
func (*Modem) SetCarrierProfile ¶
func (m *Modem) SetCarrierProfile(profile CarrierProfile) error
SetCarrierProfile updates the carrier profile in the modem
func (*Modem) SetTechnology ¶
func (m *Modem) SetTechnology(tech Technology) error
SetTechnology updates the network technology setting in the modem
func (*Modem) SwitchCmdMode ¶
SwitchCmdMode switches the mode modem to command mode try 3 times
type ModemManager ¶
type ModemManager struct {
// contains filtered or unexported fields
}
ModemManager is used to configure a modem and manage the modem lifecycle.
func (*ModemManager) GetState ¶
func (mm *ModemManager) GetState() (ModemState, error)
GetState must be called periodically to process the modem life cycle -- perhaps every 10s
type ModemSettings ¶
type ModemSettings struct { APN string CarrierProfile CarrierProfile Technology Technology Mode Mode }
ModemSettings describe the current modem settings
func (ModemSettings) String ¶
func (ms ModemSettings) String() string
type ModemState ¶
ModemState describes the current state of the modem
func (ModemState) String ¶
func (ms ModemState) String() string
type Technology ¶
type Technology int
Technology is used to define Cat-M or NB-Iot operation
func (Technology) String ¶
func (nt Technology) String() string