btmgmt

package
v0.0.0-...-04c4f09 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 15

Documentation

Index

Constants

View Source
const (
	DefaultBinPath = "btmgmt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BtAdapter

type BtAdapter struct {
	ID                string
	Name              string
	ShortName         string
	Addr              string
	Version           string
	Manufacturer      string
	Class             string
	SupportedSettings []string
	CurrentSettings   []string
}

BtAdapter contains info about adapter from btmgmt

func GetAdapter

func GetAdapter(adapterID string) (*BtAdapter, error)

GetAdapter return an adapter

func GetAdapters

func GetAdapters() ([]*BtAdapter, error)

GetAdapters return a list of adapters

type BtMgmt

type BtMgmt struct {

	// BinPath configure the CLI path to btmgmt
	BinPath string
	// contains filtered or unexported fields
}

BtMgmt btmgmt command wrapper

func NewBtMgmt

func NewBtMgmt(adapterID string) *BtMgmt

NewBtMgmt init a new BtMgmt command

func (*BtMgmt) Reset

func (h *BtMgmt) Reset() error

Reset reset the power

func (*BtMgmt) SetAdvertising

func (h *BtMgmt) SetAdvertising(status bool) error

SetAdvertising Set LE advertising

func (*BtMgmt) SetBondable

func (h *BtMgmt) SetBondable(status bool) error

SetBondable Set bondable state

func (*BtMgmt) SetBredr

func (h *BtMgmt) SetBredr(status bool) error

SetBredr Set BR/EDR support

func (*BtMgmt) SetClass

func (h *BtMgmt) SetClass(major, minor string) error

SetClass set device class

func (*BtMgmt) SetConnectable

func (h *BtMgmt) SetConnectable(status bool) error

SetConnectable Set connectable state

func (*BtMgmt) SetDeviceID

func (h *BtMgmt) SetDeviceID(did string) error

SetDeviceID Set Device ID name

func (*BtMgmt) SetDiscoverable

func (h *BtMgmt) SetDiscoverable(status bool) error

SetDiscoverable Set discoverable state

func (*BtMgmt) SetFastConnectable

func (h *BtMgmt) SetFastConnectable(status bool) error

SetFastConnectable Set fast connectable state

func (*BtMgmt) SetHs

func (h *BtMgmt) SetHs(status bool) error

SetHs Set HS support

func (*BtMgmt) SetLe

func (h *BtMgmt) SetLe(status bool) error

SetLe Set LE support

func (*BtMgmt) SetLinkLevelSecurity

func (h *BtMgmt) SetLinkLevelSecurity(status bool) error

SetLinkLevelSecurity Set link level security

func (*BtMgmt) SetName

func (h *BtMgmt) SetName(name string) error

SetName Set local name

func (*BtMgmt) SetPairable

func (h *BtMgmt) SetPairable(status bool) error

SetPairable Set bondable state

func (*BtMgmt) SetPowered

func (h *BtMgmt) SetPowered(status bool) error

SetPowered set power to adapter

func (*BtMgmt) SetPrivacy

func (h *BtMgmt) SetPrivacy(status bool) error

SetPrivacy Set privacy support

func (*BtMgmt) SetSc

func (h *BtMgmt) SetSc(status bool) error

SetSc Toogle SC support

func (*BtMgmt) SetSsp

func (h *BtMgmt) SetSsp(status bool) error

SetSsp Set SSP mode

Jump to

Keyboard shortcuts

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