huawei

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

README

huawei-mini-library

Go Reference

Package huawei provides a lightweight interface for communicating with the Huawei E5336B dongle.

This package simplifies interaction with the Huawei E5336B dongle by offering a minimal API for device communication, SMS management, and connection monitoring.

thanks to max246

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERROR_LOGIN_ALREADY_LOGIN = 108003
View Source
var ERROR_LOGIN_PASSWORD_WRONG = 108002
View Source
var ERROR_LOGIN_USERNAME_PWD_ORERRUN = 108007
View Source
var ERROR_LOGIN_USERNAME_PWD_WRONG = 108006
View Source
var ERROR_LOGIN_USERNAME_WRONG = 108001
View Source
var ERROR_SYSTEM_BUSY = 100004
View Source
var ERROR_SYSTEM_NO_RIGHTS = "100003"
View Source
var ERROR_SYSTEM_NO_SUPPORT = 100002
View Source
var ERROR_VOICE_BUSY = 120001
View Source
var ERROR_WRONG_TOKEN = 125001

Functions

This section is empty.

Types

type ConnectionStatusResponse

type ConnectionStatusResponse struct {
	XMLName              xml.Name `xml:"response"`
	ConnectionStatus     string   `xml:"ConnectionStatus"`
	SignalStrength       string   `xml:"SignalStrength"`
	SignalIcon           string   `xml:"SignalIcon"`
	CurrentNetworkType   string   `xml:"CurrentNetworkType"`
	CurrentServiceDomain string   `xml:"CurrentServiceDomain"`
	RoamingStatus        string   `xml:"RoamingStatus"`
	BatteryStatus        string   `xml:"BatteryStatus"`
	BatteryLevel         string   `xml:"BatteryLevel"`
	SimlockStatus        string   `xml:"SimlockStatus"`
	WanIPAddress         string   `xml:"WanIPAddress"`
	PrimaryDNS           string   `xml:"PrimaryDns"`
	SecondaryDNS         string   `xml:"SecondaryDns"`
	CurrentWifiUser      string   `xml:"CurrentWifiUser"`
	TotalWifiUser        string   `xml:"TotalWifiUser"`
	ServiceStatus        string   `xml:"ServiceStatus"`
	SimStatus            string   `xml:"SimStatus"`
	WifiStatus           string   `xml:"WifiStatus"`
}

type ErrorResponse

type ErrorResponse struct {
	XMLName xml.Name
}

type Huawei

type Huawei struct {
	IP string
	// contains filtered or unexported fields
}

func NewHuawei

func NewHuawei(ip string) *Huawei

func (*Huawei) Connect

func (h *Huawei) Connect() error

func (*Huawei) DeleteSMS

func (h *Huawei) DeleteSMS(index int) error

func (*Huawei) Disconnect

func (h *Huawei) Disconnect() error

func (*Huawei) GetConnectionStatus

func (h *Huawei) GetConnectionStatus() ([]string, error)

func (*Huawei) GetSmsCount

func (h *Huawei) GetSmsCount() ([]string, error)

func (*Huawei) GetSmsList

func (h *Huawei) GetSmsList() ([]SMS, error)

func (*Huawei) GetToken

func (h *Huawei) GetToken() error

func (*Huawei) IsConnected

func (h *Huawei) IsConnected() (bool, error)

func (*Huawei) Login

func (h *Huawei) Login(username, password string) error

func (*Huawei) SendSMS

func (h *Huawei) SendSMS(msg, phone string) error

type Response

type Response struct {
	XMLName xml.Name `xml:"response"`
	Status  string   `xml:",chardata"`
}

type SMS

type SMS struct {
	Smstat   string `xml:"Smstat"`
	Index    string `xml:"Index"`
	Phone    string `xml:"Phone"`
	Content  string `xml:"Content"`
	Date     string `xml:"Date"`
	Sca      string `xml:"Sca"`
	SaveType string `xml:"SaveType"`
	Priority string `xml:"Priority"`
	SmsType  string `xml:"SmsType"`
}

type SMSCountResponse

type SMSCountResponse struct {
	XMLName      xml.Name `xml:"response"`
	LocalUnread  string   `xml:"LocalUnread"`
	LocalInbox   string   `xml:"LocalInbox"`
	LocalOutbox  string   `xml:"LocalOutbox"`
	LocalDraft   string   `xml:"LocalDraft"`
	LocalDeleted string   `xml:"LocalDeleted"`
	SimUnread    string   `xml:"SimUnread"`
	SimInbox     string   `xml:"SimInbox"`
	SimOutbox    string   `xml:"SimOutbox"`
	SimDraft     string   `xml:"SimDraft"`
	LocalMax     string   `xml:"LocalMax"`
	SimMax       string   `xml:"SimMax"`
}

type SMSListResponse

type SMSListResponse struct {
	XMLName  xml.Name `xml:"response"`
	Count    int      `xml:"Count"`
	Messages []SMS    `xml:"Messages>Message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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