bluetooth

package
v0.0.0-...-b320325 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBtSvcNotAvailable = errors.New("No bluetooth available")
	ErrBtNoMgmt          = errors.New("Couldn't access bluetooth mgmt-api")
	ErrChgSetting        = errors.New("Couldn't change controller setting to intended value")
	ErrReadSetting       = errors.New("Couldn't read controller setting")
	ErrDeviceNotFOund    = errors.New("Couldn't find given device")
)

Functions

func BluetoothControllerInformationFromRpc

func BluetoothControllerInformationFromRpc(src *pb.BluetoothControllerInformation) (target *btmgmt.ControllerInformation)

func BluetoothControllerInformationToRpc

func BluetoothControllerInformationToRpc(src *btmgmt.ControllerInformation) (target *pb.BluetoothControllerInformation)

func BluetoothControllerSettingsFromRpc

func BluetoothControllerSettingsFromRpc(src *pb.BluetoothControllerSettings) (target *btmgmt.ControllerSettings)

func BluetoothControllerSettingsToRpc

func BluetoothControllerSettingsToRpc(src *btmgmt.ControllerSettings) (target *pb.BluetoothControllerSettings)

Types

type Controller

type Controller struct {
	DBusPath dbus.ObjectPath // The path of the controller, used by DBus (f.e. 'hci0')
	Index    uint16          // The index of the controller, when "Bluetooth Management Socket" is used (mgmt-api)
	// contains filtered or unexported fields
}

func FindFirstAvailableController

func FindFirstAvailableController() (ctl *Controller, err error)

func (*Controller) CheckUUIDList

func (c *Controller) CheckUUIDList(uuidsToCheck []string) (res []bool, err error)

Check if given UUIDs are present on adapter

func (*Controller) ConnectNetwork

func (c *Controller) ConnectNetwork(deviceMac string, uuid toolz.NetworkServerUUID) (err error)

func (*Controller) DisconnectNetwork

func (c *Controller) DisconnectNetwork(deviceMac string) (err error)

func (*Controller) GetAddress

func (c *Controller) GetAddress() (res net.HardwareAddr, err error)

Properties

func (*Controller) GetAddressType

func (c *Controller) GetAddressType() (res string, err error)

func (*Controller) GetAlias

func (c *Controller) GetAlias() (res string, err error)

func (*Controller) GetClass

func (c *Controller) GetClass() (res uint32, err error)

func (*Controller) GetDeviceByAddr

func (c *Controller) GetDeviceByAddr(addr net.HardwareAddr) (res *toolz.Device1, err error)

func (*Controller) GetDevices

func (c *Controller) GetDevices() (results []*toolz.Device1, err error)

func (*Controller) GetDiscoverable

func (c *Controller) GetDiscoverable() (res bool, err error)

func (*Controller) GetDiscoverableTimeout

func (c *Controller) GetDiscoverableTimeout() (res uint32, err error)

func (*Controller) GetDiscovering

func (c *Controller) GetDiscovering() (res bool, err error)

func (*Controller) GetModalias

func (c *Controller) GetModalias() (res string, err error)

func (*Controller) GetName

func (c *Controller) GetName() (res string, err error)

func (*Controller) GetPairable

func (c *Controller) GetPairable() (res bool, err error)

func (*Controller) GetPairableTimeout

func (c *Controller) GetPairableTimeout() (res uint32, err error)

func (*Controller) GetPathDevices

func (c *Controller) GetPathDevices() (results []dbus.ObjectPath, err error)

func (*Controller) GetPowered

func (c *Controller) GetPowered() (res bool, err error)

func (*Controller) GetUUIDs

func (c *Controller) GetUUIDs() (res []string, err error)

func (*Controller) IsServerGNEnabled

func (c *Controller) IsServerGNEnabled() (res bool, err error)

func (*Controller) IsServerNAPEnabled

func (c *Controller) IsServerNAPEnabled() (res bool, err error)

func (*Controller) IsServerPANUEnabled

func (c *Controller) IsServerPANUEnabled() (res bool, err error)

func (*Controller) ReadControllerInformation

func (c *Controller) ReadControllerInformation() (ctlInfo *btmgmt.ControllerInformation, err error)

func (*Controller) RegisterNetworkServer

func (c *Controller) RegisterNetworkServer(uuid toolz.NetworkServerUUID, bridgeName string) (err error)

func (*Controller) SetAlias

func (c *Controller) SetAlias(val string) (err error)

func (*Controller) SetBondable

func (c *Controller) SetBondable(val bool) (err error)

func (*Controller) SetConnectable

func (c *Controller) SetConnectable(val bool) (err error)

func (*Controller) SetDiscoverable

func (c *Controller) SetDiscoverable(val bool) (err error)

func (*Controller) SetDiscoverableExt

func (c *Controller) SetDiscoverableExt(discoverable bool, timeout time.Duration) (err error)

func (*Controller) SetDiscoverableTimeout

func (c *Controller) SetDiscoverableTimeout(val uint32) (err error)

func (*Controller) SetFastConnectable

func (c *Controller) SetFastConnectable(val bool) (err error)

func (*Controller) SetHighSpeed

func (c *Controller) SetHighSpeed(val bool) (err error)

func (*Controller) SetLinkLevelSecurity

func (c *Controller) SetLinkLevelSecurity(val bool) (err error)

func (*Controller) SetLowEnergy

func (c *Controller) SetLowEnergy(val bool) (err error)

func (*Controller) SetPairable

func (c *Controller) SetPairable(val bool) (err error)

func (*Controller) SetPairableTimeout

func (c *Controller) SetPairableTimeout(val uint32) (err error)

func (*Controller) SetPowered

func (c *Controller) SetPowered(val bool) (err error)

func (*Controller) SetSSP

func (c *Controller) SetSSP(val bool) (err error)

func (*Controller) StartDiscovery

func (c *Controller) StartDiscovery() error

func (*Controller) StopDiscovery

func (c *Controller) StopDiscovery() error

func (*Controller) UnregisterNetworkServer

func (c *Controller) UnregisterNetworkServer(uuid toolz.NetworkServerUUID) (err error)

func (*Controller) UpdateSettingsFromChangedControllerInformation

func (c *Controller) UpdateSettingsFromChangedControllerInformation(newCi *btmgmt.ControllerInformation, bridgeNameNAP string, bridgeNamePANU string, bridgeNameGN string) (currentCi *btmgmt.ControllerInformation, err error)

type DefaultAgent

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

func NewDefaultAgent

func NewDefaultAgent(pincode string) (res *DefaultAgent)

func (*DefaultAgent) AuthorizeService

func (a *DefaultAgent) AuthorizeService(device dbus.ObjectPath, uuid string) *dbus.Error

func (*DefaultAgent) Cancel

func (a *DefaultAgent) Cancel() *dbus.Error

func (*DefaultAgent) DisplayPasskey

func (a *DefaultAgent) DisplayPasskey(device dbus.ObjectPath, passkey uint32, entered uint16) *dbus.Error

func (*DefaultAgent) DisplayPinCode

func (a *DefaultAgent) DisplayPinCode(device dbus.ObjectPath, pincode string) *dbus.Error

func (*DefaultAgent) GetPIN

func (a *DefaultAgent) GetPIN() (pin string)

func (*DefaultAgent) RegistrationPath

func (a *DefaultAgent) RegistrationPath() string

------------ START OF AGENT INTERFACE IMPLEMENTATION ------------

func (*DefaultAgent) Release

func (a *DefaultAgent) Release() *dbus.Error

func (*DefaultAgent) RequestAuthorization

func (a *DefaultAgent) RequestAuthorization(device dbus.ObjectPath) *dbus.Error

func (*DefaultAgent) RequestConfirmation

func (a *DefaultAgent) RequestConfirmation(device dbus.ObjectPath, passkey uint32) *dbus.Error

func (*DefaultAgent) RequestPasskey

func (a *DefaultAgent) RequestPasskey(device dbus.ObjectPath) (passkey uint32, err *dbus.Error)

func (*DefaultAgent) RequestPinCode

func (a *DefaultAgent) RequestPinCode(device dbus.ObjectPath) (pincode string, err *dbus.Error)

func (*DefaultAgent) SetPIN

func (a *DefaultAgent) SetPIN(pin string)

func (*DefaultAgent) Start

func (a *DefaultAgent) Start(cap toolz.AgentCapability) (err error)

func (*DefaultAgent) Stop

func (a *DefaultAgent) Stop() (err error)

Jump to

Keyboard shortcuts

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