wifi

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WifiInterfaceNamePrefixes = []string{"wlan", "wlp"}

Functions

This section is empty.

Types

type Wifi

type Wifi struct {
	EthIface            string
	WifiIface           string
	DHCPDLeaseFile      string
	DHCPCDLeaseFile     string
	DNSKeyFile          string
	CaptivePortalURL    string
	CountryCode         string
	WriteHostResolvConf bool
	// contains filtered or unexported fields
}

func New

func New(logger *logrus.Entry, dataDir string, onProcessTermination runner.StatusReportFunc) *Wifi

func (*Wifi) Close

func (w *Wifi) Close() (err error)

func (*Wifi) DetectCountry

func (w *Wifi) DetectCountry() error

DetectCountry derives the wifi country based on near wifi networks.

func (*Wifi) Mode

func (w *Wifi) Mode() WifiMode

func (*Wifi) Networks

func (w *Wifi) Networks() []WifiNetwork

Networks returns the list of available wifi networks.

func (*Wifi) StartAccessPoint

func (w *Wifi) StartAccessPoint(ssid, password string) error

func (*Wifi) StartStation

func (w *Wifi) StartStation(ssid, password string) error

func (*Wifi) StartWifiInterface

func (w *Wifi) StartWifiInterface() error

func (*Wifi) StopAccessPoint

func (w *Wifi) StopAccessPoint()

func (*Wifi) StopStation

func (w *Wifi) StopStation()

func (*Wifi) StopWifiInterface

func (w *Wifi) StopWifiInterface() error

type WifiMode

type WifiMode string
const (
	WifiModeDisabled    WifiMode = "disabled"
	WifiModeStation     WifiMode = "station"
	WifiModeAccessPoint WifiMode = "accesspoint"
)

type WifiNetwork

type WifiNetwork struct {
	MAC     string
	SSID    string
	Country string
}

Jump to

Keyboard shortcuts

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