urfkill

package
v0.0.0-...-d997c1c Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: GPL-3.0, GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package urfkill wraps a couple of URfkill's DBus API points to watch for flight mode state changes.

Index

Constants

This section is empty.

Variables

View Source
var BusAddress bus.Address = bus.Address{
	Interface: "org.freedesktop.URfkill",
	Path:      "/org/freedesktop/URfkill",
	Name:      "org.freedesktop.URfkill",
}

URfkill lives on a well-knwon bus.Address

View Source
var WLANKillswitchBusAddress bus.Address = bus.Address{
	Interface: "org.freedesktop.URfkill.Killswitch",
	Path:      "/org/freedesktop/URfkill/WLAN",
	Name:      "org.freedesktop.URfkill",
}

URfkill lives on a well-knwon bus.Address

Functions

This section is empty.

Types

type KillswitchState

type KillswitchState int32
const (
	KillswitchStateUnblocked KillswitchState = iota
	KillswitchStateSoftBlocked
	KillswitchStateHardBlocked
	KillswitchStateMax
)

func (KillswitchState) IsValid

func (ks KillswitchState) IsValid() bool

type URfkill

type URfkill interface {
	// IsFlightMode returns flight mode state.
	IsFlightMode() bool
	// WatchFlightMode listens for changes to URfkill's flight
	// mode state, and sends them out over the channel returned.
	WatchFlightMode() (<-chan bool, bus.Cancellable, error)
	// GetWLANKillswitchState fetches and returns URfkill's
	// WLAN killswitch state.
	GetWLANKillswitchState() KillswitchState
	// WatchWLANKillswitchState listens for changes of URfkill's
	// WLAN killswtich state, and sends them out over the channel returned.
	WatchWLANKillswitchState() (<-chan KillswitchState, bus.Cancellable, error)
}

func New

func New(endp bus.Endpoint, wlanKillswitch bus.Endpoint, log logger.Logger) URfkill

New returns a new URfkill that'll use the provided bus.Endpoints for BusAddress and WLANKillswitchBusAddress

Jump to

Keyboard shortcuts

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