linux

package
v0.0.0-...-f9b8134 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdExec

func CmdExec(args ...string) (string, error)

CmdExec Execute a command

func Down

func Down(adapterID int) error

Down turn down an HCI device

func List

func List() ([]int, error)

List list available HCI devices

func RestartBluetoothUnit

func RestartBluetoothUnit(fn func(err error)) (int, error)

RestartBluetoothUnit by its systemd unit

func StartBluetoothUnit

func StartBluetoothUnit(fn func(err error)) (int, error)

StartBluetoothUnit by its systemd unit

func StopBluetoothUnit

func StopBluetoothUnit(fn func(err error)) (int, error)

StopBluetoothUnit by its systemd unit

func Up

func Up(adapterID int) error

Up turn up an HCI device

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 (rfkill RFKill) IsBlocked(identifier string) bool

IsBlocked Checks if an identifier has a software or hardware block

func (RFKill) IsBlockedAfterUnblocking

func (rfkill 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 (rfkill RFKill) IsHardBlocked(identifier string) bool

IsHardBlocked Checks if an identifier has a hardware block

func (RFKill) IsInstalled

func (rfkill RFKill) IsInstalled() bool

IsInstalled Checks if the program rfkill exists using PATH environment variable

func (RFKill) IsSoftBlocked

func (rfkill RFKill) IsSoftBlocked(identifier string) bool

IsSoftBlocked Checks if an identifier has a software block

func (RFKill) ListAll

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

ListAll Returns a list of rfkill results for every identifier type

func (RFKill) SoftBlock

func (rfkill RFKill) SoftBlock(identifier string) error

SoftBlock RFKill Sets a software block on an identifier

func (RFKill) SoftUnblock

func (rfkill 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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