airplane_mode

package
v0.0.0-...-61f35a2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config indicate each module config state when config is not set in the beginning, block is false as default

func NewConfig

func NewConfig() *Config

NewConfig create config obj

func (*Config) GetBlocked

func (cfg *Config) GetBlocked(module rfkillType) bool

GetBlocked get ref config state if config is not stored, rfkill is unblocked as default

func (*Config) LoadConfig

func (cfg *Config) LoadConfig() error

LoadConfig load config from file

func (*Config) SaveConfig

func (cfg *Config) SaveConfig() error

SaveConfig save config to file

func (*Config) SetBlocked

func (cfg *Config) SetBlocked(module rfkillType, blocked bool)

SetBlocked set ref config state

type Manager

type Manager struct {

	// Airplane Mode status
	Enabled          bool
	HasAirplaneMode  bool
	WifiEnabled      bool
	BluetoothEnabled bool
	// contains filtered or unexported fields
}

func (*Manager) DumpState

func (mgr *Manager) DumpState() *dbus.Error

func (*Manager) Enable

func (mgr *Manager) Enable(sender dbus.Sender, enableAirplaneMode bool) *dbus.Error

Enable enable or disable *Airplane Mode*, isn't enable the devices

func (*Manager) EnableBluetooth

func (mgr *Manager) EnableBluetooth(sender dbus.Sender, enableAirplaneMode bool) *dbus.Error

EnableBluetooth enable or disable *Airplane Mode* for bluetooth, isn't enable the bluetooth devices

func (*Manager) EnableWifi

func (mgr *Manager) EnableWifi(sender dbus.Sender, enableAirplaneMode bool) *dbus.Error

EnableWifi enable or disable *Airplane Mode* for wlan, isn't enable the wlan devices

func (*Manager) GetExportedMethods

func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods

func (*Manager) GetInterfaceName

func (mgr *Manager) GetInterfaceName() string

type Module

type Module struct {
	*loader.ModuleBase
	// contains filtered or unexported fields
}

func NewModule

func NewModule() *Module

func (*Module) GetDependencies

func (m *Module) GetDependencies() []string

func (*Module) Start

func (m *Module) Start() error

func (*Module) Stop

func (m *Module) Stop() error

type RadioAction

type RadioAction int

RadioAction radio action use rfkill to operate radio

const (
	NoneRadioAction RadioAction = iota
	BlockRadioAction
	UnblockRadioAction
	ListRadioAction
	MonitorRadioAction
)

func (RadioAction) String

func (action RadioAction) String() string

String action

func (RadioAction) ToRfkillState

func (action RadioAction) ToRfkillState() rfkillState

ToRfkillState convert to rfkill action

type RfkillEvent

type RfkillEvent struct {
	Index uint32
	Typ   rfkillType
	Op    rfkillOp
	Soft  rfkillState
	Hard  rfkillState
}

RfkillEvent rfkill event

Jump to

Keyboard shortcuts

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