mh5000_31

package
v0.0.0-...-e3f82b8 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

utils.go: Convert to human readable format

Index

Constants

View Source
const (
	//IMEI IMEI :)
	IMEI = "AT+GSN"
	//ATI ask minor information of devices.
	ATI = "ATI"
	//HCSQ ask what type of signal is using , and  it's strength
	HCSQ = "AT^HCSQ?"
	//EONS Query network operator name and sim card EFSPN info
	EONS = "AT^EONS"
	//SYSINFOEX ask system(Network) Info
	SYSINFOEX = "AT^SYSINFOEX"
	//COPS Query is it register to operator.
	COPS = "AT+COPS?"
	//CPIN Query and management Pin code.
	CPIN = "AT+CPIN"
	//LENDC? Query it is NSA Signal
	LENDC = "AT^LENDC?"
	//C5GREG  5g register status
	C5GREG = "AT+C5GREG"
	//CGPADDR Get addr after dial
	CGPADDR = "AT+CGPADDR"

	NDISDUP = "AT^NDISDUP"
)
View Source
const (
	//No service
	NoService = "NOSERVICE"
	//GSM  GSM/GRPS/EDGE mode
	GSM = "GSM"
	//WCDMA	WCDMA/HSDPA/HSPA mode
	WCDMA = "WCDMA"
	//LTE <-mode
	LTE = "LTE"
	//NR : 5G!!!!!
	NR = "NR"
)

Network mode status

Variables

This section is empty.

Functions

func GetModem

func GetModem(huawei *HUAWEI) goat.Modem

func MustInt

func MustInt(s string) (i int)

func RemoveCrCL

func RemoveCrCL(str string) string

RemoveCrCL remove CR AND CL

func RemoveQuote

func RemoveQuote(str string) string

RemoveQuote remove " prefix and suffix

func Result2Array

func Result2Array(str, prefix, sep string) []string

Types

type HCSQs

type HCSQs struct {
	Data []string `json:"-"`
	*devices.HCSQs
}

func (*HCSQs) Serialization

func (h *HCSQs) Serialization() ([]byte, error)

type HUAWEI

type HUAWEI struct {
	*devices.Device
}

func (*HUAWEI) ATI

func (h *HUAWEI) ATI() (devices.Product, error)

ATI ask minor information of devices.

func (*HUAWEI) C5GREG

func (h *HUAWEI) C5GREG() (n NrRegStatus, err error)

C5GREG: AT+C5GREG Only use it when it using 5g networking.

func (*HUAWEI) CGPADDR

func (h *HUAWEI) CGPADDR() (ip net.IP, err error)

CGPADDR

func (*HUAWEI) COPS

func (h *HUAWEI) COPS() (result Plmn, err error)

Cops string

func (*HUAWEI) CPIN

func (h *HUAWEI) CPIN() (ok bool, err error)

CPIN just check if it ready.

func (*HUAWEI) EONS

func (h *HUAWEI) EONS() (str string, err error)

EONS get operate network name and sim efspn information

func (*HUAWEI) HCSQ

func (h *HUAWEI) HCSQ() ([]HCSQs, error)

HCSQ ask what type of signal is using , and it's strength

func (*HUAWEI) IMEI

func (h *HUAWEI) IMEI() (str string, err error)

IMEI Get IMEI

func (*HUAWEI) Init

func (h *HUAWEI) Init(portName string, opt ...serial.Option)

Init if device is nil , use default.

func (*HUAWEI) LENDC

func (h *HUAWEI) LENDC() (L LenDc, err error)

LENDC: Got lendc result

func (*HUAWEI) NDISDUP

func (h *HUAWEI) NDISDUP(config int, on int) (ok bool, err error)

NDISDUP Dial up with config.

func (*HUAWEI) Result

func (h *HUAWEI) Result(str string) (bool, error)

Result Deal with buff result.

func (*HUAWEI) SYSINFO

func (h *HUAWEI) SYSINFO() (d devices.SysInfoEx, err error)

SYSINFO show system info

type LenDc

type LenDc struct {
	//Enable
	Enable bool `json:"enable"`
	//Is it support endc(NR)?
	Available bool `json:"endc_available"`
	// false : not support , true , support.
	PlmnAvailable bool `json:"endc_plmn_available"`
	// false mean restricted , true means note restricted
	Restricted bool `json:"endc_restricted"`
	//Is is NR ENDC now
	Pscell bool `json:"nr_pscell"`
}

type Lte

type Lte struct {
	*HCSQs
}

Lte interface

func (*Lte) RSRP

func (l *Lte) RSRP()

RSRP Lte impalement

func (*Lte) RSRQ

func (l *Lte) RSRQ()

Rsrq Lte impalement

func (*Lte) RSSI

func (l *Lte) RSSI()

Rssi Lte impalement

func (*Lte) SINR

func (l *Lte) SINR()

Sinr Lte impalement

type Modem

type Modem struct {
	// contains filtered or unexported fields
}

func (*Modem) CurrentNetwork

func (m *Modem) CurrentNetwork() (string, error)

What Network provider now?

func (*Modem) DeviceInfo

func (m *Modem) DeviceInfo() (goat.Product, error)

Get Devices info

func (*Modem) Dial

func (m *Modem) Dial() error

Dial operator

func (*Modem) IsNSA

func (m *Modem) IsNSA() bool

iS NSA or SA?

func (*Modem) IsRegistered

func (m *Modem) IsRegistered() bool

is it register to operator

func (*Modem) PDPAddr

func (m *Modem) PDPAddr() (net.IP, error)

Ipv4 or ipv6 and it's addr

func (*Modem) PinLockStatus

func (m *Modem) PinLockStatus() bool

Pin management PinLockStatus Query pin lock status

func (*Modem) SignalStrength

func (m *Modem) SignalStrength() (data []goat.HCSQs, err error)

Query Signal strength

type Nr

type Nr struct {
	*HCSQs
}

func (*Nr) RSRP

func (n *Nr) RSRP()

Rsrp Nr(5g) impalement

func (Nr) RSRQ

func (n Nr) RSRQ()

Rsrq Nr(5g) impalement

func (*Nr) SINR

func (n *Nr) SINR()

Sinr Nr(5g) impalement

type NrRegStatus

type NrRegStatus struct {
	ReportStatus int `json:"n"`
	Stat         int `json:"stat"`
}

Only use it when it using 5g status

type Plmn

type Plmn struct {
	Mode      int    `json:"mode"`
	Format    int    `json:"format"`
	Operator  string `json:"oper"`
	RadioType int    `json:"rat"`
}

Plmn: Public Land Mobile Network

func (*Plmn) GetFormat

func (p *Plmn) GetFormat() string

GetFormat human readable format

func (*Plmn) GetMode

func (p *Plmn) GetMode() string

GetMode human readable format

func (*Plmn) GetRadioType

func (p *Plmn) GetRadioType() string

GetRadioType human readable format

type Wcdma

type Wcdma struct {
	*HCSQs
}

Wcdma interface

func (Wcdma) ECIO

func (Wcdma) ECIO(i int) string

ECIO ECIO for wcdma only

func (Wcdma) RSCP

func (Wcdma) RSCP(i int) string

RSRP rsrp for wcdma only

func (*Wcdma) RSSI

func (w *Wcdma) RSSI()

RSSI wcdma impalement

Jump to

Keyboard shortcuts

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