rfkill

package
v0.0.0-...-7f43d4a Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHCIConfig

func GetHCIConfig(adapterID string) *hciconfig.HCIConfig

GetHCIConfig return an HCIConfig struct

func ToggleAdapter

func ToggleAdapter(adapterID string) error

ToggleAdapter Swap Off/On a device

func ToggleBluetooth

func ToggleBluetooth() error

ToggleBluetooth toggle off/on the bluetooth support

func TurnOffAdapter

func TurnOffAdapter(adapterID string) error

TurnOffAdapter Enable a rfkill managed device

func TurnOffBluetooth

func TurnOffBluetooth() error

TurnOffBluetooth turn on bluetooth support

func TurnOnAdapter

func TurnOnAdapter(adapterID string) error

TurnOnAdapter Enable a rfkill managed device

func TurnOnBluetooth

func TurnOnBluetooth() error

TurnOnBluetooth turn on bluetooth support

Types

type RFKill

type RFKill struct{}

RFKill is a wrapper for linux utility: rfkill Checks the status of kill switches. If either is set, the device will be disabled. Soft = Software (set by software) Hard = Hardware (physical on/off switch on the device) Identifiers = all, wifi, wlan, bluetooth, uwb, ultrawideband, wimax, wwan, gps, fm See: http://wireless.kernel.org/en/users/Documentation/rfkill

func NewRFKill

func NewRFKill() RFKill

NewRFKill Creates a new RFKill instance

func (RFKill) IsBlocked

func (self RFKill) IsBlocked(identifier string) bool

IsBlocked Checks if an identifier has a software or hardware block

func (RFKill) IsBlockedAfterUnblocking

func (self RFKill) IsBlockedAfterUnblocking(identifier string) bool

IsBlockedAfterUnblocking Checks if an identifier has a software or hardware block after removing a software block if it exists

func (RFKill) IsHardBlocked

func (self RFKill) IsHardBlocked(identifier string) bool

IsHardBlocked Checks if an identifier has a hardware block

func (RFKill) IsInstalled

func (self RFKill) IsInstalled() bool

IsInstalled Checks if the program rfkill exists using PATH environment variable

func (RFKill) IsSoftBlocked

func (self RFKill) IsSoftBlocked(identifier string) bool

IsSoftBlocked Checks if an identifier has a software block

func (RFKill) ListAll

func (self RFKill) ListAll() ([]RFKillResult, error)

ListAll Returns a list of rfkill results for every identifier type

func (RFKill) SoftBlock

func (self RFKill) SoftBlock(identifier string) error

SoftBlock RFKill Sets a software block on an identifier

func (RFKill) SoftUnblock

func (self RFKill) SoftUnblock(identifier string) error

SoftUnblock Removes a software block on an identifier

type RFKillResult

type RFKillResult struct {
	Index          int
	IdentifierType string
	Description    string
	SoftBlocked    bool
	HardBlocked    bool
}

RFKillResult Result of rfkill request

func GetAdapterStatus

func GetAdapterStatus(adapterID string) (*RFKillResult, error)

GetAdapterStatus return the status of an adapter

Jump to

Keyboard shortcuts

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