toolz

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PropAdapterAddress             = "Address"             //readonly, string -> net.HardwareAddr
	PropAdapterAddressType         = "AddressType"         //readonly, string
	PropAdapterName                = "Name"                //readonly, string
	PropAdapterAlias               = "Alias"               //readwrite, string
	PropAdapterClass               = "Class"               //readonly, uint32
	PropAdapterPowered             = "Powered"             //readwrite, bool
	PropAdapterDiscoverable        = "Discoverable"        //readwrite, bool
	PropAdapterPairable            = "Pairable"            //readwrite, bool
	PropAdapterPairableTimeout     = "PairableTimeout"     //readwrite, uint32
	PropAdapterDiscoverableTimeout = "DiscoverableTimeout" //readwrite, uint32
	PropAdapterDiscovering         = "Discovering"         //readonly, bool
	PropAdapterUUIDs               = "UUIDs"               //readonly, []string
	PropAdapterModalias            = "Modalias"            //readonly, optional, string
)
View Source
const (
	PropDeviceAddress          = "Address"          //readonly, string -> net.HardwareAddr
	PropDeviceAddressType      = "AddressType"      //readonly, string
	PropDeviceName             = "Name"             //readonly, optional, string
	PropDeviceIcon             = "Icon"             //readonly, optional, string
	PropDeviceClass            = "Class"            //readonly, optional, uint32
	PropDeviceAppearance       = "Appearance"       //readonly, optional, uint16
	PropDeviceUUIDs            = "UUIDs"            //readonly, optional, []string
	PropDevicePaired           = "Paired"           //readonly, bool
	PropDeviceConnected        = "Connected"        //readonly, bool
	PropDeviceTrusted          = "Trusted"          //readwrite, bool
	PropDeviceBlocked          = "Blocked"          //readwrite, bool
	PropDeviceAlias            = "Alias"            //readwrite, string
	PropDeviceAdapter          = "Adapter"          //readonly, ObjectPath
	PropDeviceLegacyPairing    = "LegacyPairing"    //readonly, bool
	PropDeviceModalias         = "Modalias"         //readonly, optional, string
	PropDeviceRSSI             = "RSSI"             //readonly, optional, uint16
	PropDeviceTxPower          = "TxPower"          //readonly, optional, uint16
	PropDeviceManufacturerData = "ManufacturerData" //readonly, optional, map[???]???
	PropDeviceServiceData      = "ServiceData"      //readonly, optional, map[string][]byte ??
	PropDeviceServicesResolved = "ServicesResolved" //readonly, bool
	PropDeviceAdvertisingFlags = "AdvertisingFlags" //readonly, experimental, []byte
	PropDeviceAdvertisingData  = "AdvertisingData"  //readonly, experimental, map[uint8][]byte ???
)
View Source
const (
	PropNetworkConnected = "Connected" //bool, read only
	PropNetworkInterface = "Interface" //string, read only
	PropNetworkUUID      = "UUID"      //string, read only
)
View Source
const AgentDefaultRegisterPath = "/org/bluez/mame82agent"
View Source
const DBusNameAdapter1Interface = "org.bluez.Adapter1"

See https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt

View Source
const DBusNameAgent1Interface = "org.bluez.Agent1"
View Source
const DBusNameAgentManager1Interface = "org.bluez.AgentManager1"
View Source
const DBusNameDevice1Interface = "org.bluez.Device1"
View Source
const DBusNameNetwork1Interface = "org.bluez.Network1"
View Source
const DBusNameNetworkServer1Interface = "org.bluez.NetworkServer1"
View Source
const DBusNameProfileManager1Interface = "org.bluez.ProfileManager1"

Variables

View Source
var ErrCanceled = dbus.NewError("org.bluez.Error.Canceled", nil)
View Source
var ErrRejected = dbus.NewError("org.bluez.Error.Rejected", nil)

Functions

func AdapterNameToDBusPath

func AdapterNameToDBusPath(adapterName string) dbus.ObjectPath

func RegisterDefaultAgent

func RegisterDefaultAgent(agent Agent1Interface, caps AgentCapability) (err error)

Registers the given Agent as global default agent (used for all pairing requests)

func UnregisterAgent

func UnregisterAgent(path string) (err error)

Types

type Adapter1

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

func Adapter

func Adapter(adapterPath dbus.ObjectPath) (res *Adapter1, err error)

func (*Adapter1) Close

func (a *Adapter1) Close()

func (*Adapter1) GetAddress

func (a *Adapter1) GetAddress() (res net.HardwareAddr, err error)

Properties

func (*Adapter1) GetAddressType

func (a *Adapter1) GetAddressType() (res string, err error)

func (*Adapter1) GetAlias

func (a *Adapter1) GetAlias() (res string, err error)

func (*Adapter1) GetClass

func (a *Adapter1) GetClass() (res uint32, err error)

func (*Adapter1) GetDiscoverable

func (a *Adapter1) GetDiscoverable() (res bool, err error)

func (*Adapter1) GetDiscoverableTimeout

func (a *Adapter1) GetDiscoverableTimeout() (res uint32, err error)

func (*Adapter1) GetDiscovering

func (a *Adapter1) GetDiscovering() (res bool, err error)

func (*Adapter1) GetModalias

func (a *Adapter1) GetModalias() (res string, err error)

func (*Adapter1) GetName

func (a *Adapter1) GetName() (res string, err error)

func (*Adapter1) GetPairable

func (a *Adapter1) GetPairable() (res bool, err error)

func (*Adapter1) GetPairableTimeout

func (a *Adapter1) GetPairableTimeout() (res uint32, err error)

func (*Adapter1) GetPowered

func (a *Adapter1) GetPowered() (res bool, err error)

func (*Adapter1) GetUUIDs

func (a *Adapter1) GetUUIDs() (res []string, err error)

func (*Adapter1) SetAlias

func (a *Adapter1) SetAlias(val string) (err error)

func (*Adapter1) SetDiscoverable

func (a *Adapter1) SetDiscoverable(val bool) (err error)

func (*Adapter1) SetDiscoverableTimeout

func (a *Adapter1) SetDiscoverableTimeout(val uint32) (err error)

func (*Adapter1) SetPairable

func (a *Adapter1) SetPairable(val bool) (err error)

func (*Adapter1) SetPairableTimeout

func (a *Adapter1) SetPairableTimeout(val uint32) (err error)

func (*Adapter1) SetPowered

func (a *Adapter1) SetPowered(val bool) (err error)

func (*Adapter1) StartDiscovery

func (a *Adapter1) StartDiscovery() error

func (*Adapter1) StopDiscovery

func (a *Adapter1) StopDiscovery() error

type Agent1Interface

type Agent1Interface interface {
	Release() *dbus.Error                                                    // Callback doesn't trigger on unregister
	RequestPinCode(device dbus.ObjectPath) (pincode string, err *dbus.Error) // Triggers for pairing when SSP is off and cap != CAP_NO_INPUT_NO_OUTPUT
	DisplayPinCode(device dbus.ObjectPath, pincode string) *dbus.Error
	RequestPasskey(device dbus.ObjectPath) (passkey uint32, err *dbus.Error) // SSP on, toolz.AGENT_CAP_KEYBOARD_ONLY
	DisplayPasskey(device dbus.ObjectPath, passkey uint32, entered uint16) *dbus.Error
	RequestConfirmation(device dbus.ObjectPath, passkey uint32) *dbus.Error
	RequestAuthorization(device dbus.ObjectPath) *dbus.Error
	AuthorizeService(device dbus.ObjectPath, uuid string) *dbus.Error
	Cancel() *dbus.Error
	RegistrationPath() string
}

type AgentCapability

type AgentCapability string
const (
	AGENT_CAP_DISPLAY_ONLY       AgentCapability = "DisplayOnly"
	AGENT_CAP_DISPLAY_YES_NO     AgentCapability = "DisplayYesNo"
	AGENT_CAP_KEYBOARD_ONLY      AgentCapability = "KeyboardOnly"
	AGENT_CAP_NO_INPUT_NO_OUTPUT AgentCapability = "NoInputNoOutput"
	AGENT_CAP_KEYBOARD_DISPLAY   AgentCapability = "KeyboardDisplay"
)

type AgentManager1

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

func AgentManager

func AgentManager() (res *AgentManager1, err error)

func (*AgentManager1) Close

func (am *AgentManager1) Close()

func (*AgentManager1) ExportGoAgentToDBus

func (a *AgentManager1) ExportGoAgentToDBus(agentInstance Agent1Interface, targetPath dbus.ObjectPath) error

func (*AgentManager1) RegisterAgent

func (a *AgentManager1) RegisterAgent(agentPath dbus.ObjectPath, capability AgentCapability) error

func (*AgentManager1) RequestDefaultAgent

func (a *AgentManager1) RequestDefaultAgent(agentPath dbus.ObjectPath) error

func (*AgentManager1) UnregisterAgent

func (a *AgentManager1) UnregisterAgent(agentPath dbus.ObjectPath) error

type DBusBluezProfileOptions

type DBusBluezProfileOptions map[string]dbus.Variant

type Device1

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

func Device

func Device(devicePath dbus.ObjectPath) (res *Device1, err error)

func (*Device1) CancelPairing

func (d *Device1) CancelPairing() error

func (*Device1) Close

func (d *Device1) Close()

func (*Device1) Connect

func (d *Device1) Connect() error

func (*Device1) ConnectProfile

func (d *Device1) ConnectProfile(uuid string) error

func (*Device1) Disconnect

func (d *Device1) Disconnect() error

func (*Device1) DisconnectProfile

func (d *Device1) DisconnectProfile(uuid string) error

func (*Device1) GetAddress

func (d *Device1) GetAddress() (res net.HardwareAddr, err error)

func (*Device1) GetAddressType

func (d *Device1) GetAddressType() (res string, err error)

func (*Device1) GetAlias

func (d *Device1) GetAlias() (res string, err error)

func (*Device1) GetBlocked

func (d *Device1) GetBlocked() (res bool, err error)

func (*Device1) GetConnected

func (d *Device1) GetConnected() (res bool, err error)

func (*Device1) GetPaired

func (d *Device1) GetPaired() (res bool, err error)

func (*Device1) GetPath

func (d *Device1) GetPath() dbus.ObjectPath

func (*Device1) GetTrusted

func (d *Device1) GetTrusted() (res bool, err error)

Properties

func (*Device1) Pair

func (d *Device1) Pair() error

func (*Device1) SetAlias

func (d *Device1) SetAlias(val string) (err error)

func (*Device1) SetBlocked

func (d *Device1) SetBlocked(val bool) (err error)

func (*Device1) SetTrusted

func (d *Device1) SetTrusted(val bool) (err error)

type Network1

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

Network1

func Network

func Network(targetDevicePath dbus.ObjectPath) (res *Network1, err error)

func (*Network1) Close

func (a *Network1) Close()

func (*Network1) Connect

func (a *Network1) Connect(uuid NetworkServerUUID) error

Valid UUIDs are "gn", "panu" or "nap".

func (*Network1) Disconnect

func (a *Network1) Disconnect() error

func (*Network1) GetConnected

func (a *Network1) GetConnected() (res bool, err error)

func (*Network1) GetInterface

func (a *Network1) GetInterface() (res string, err error)

func (*Network1) GetUUID

func (a *Network1) GetUUID() (res string, err error)

type NetworkServer1

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

NetworkServer1

func NetworkServer

func NetworkServer(adapterPath dbus.ObjectPath) (res *NetworkServer1, err error)

func (*NetworkServer1) Close

func (a *NetworkServer1) Close()

func (*NetworkServer1) Register

func (a *NetworkServer1) Register(uuid NetworkServerUUID, bridge string) error

Valid UUIDs are "gn", "panu" or "nap".

func (*NetworkServer1) Unregister

func (a *NetworkServer1) Unregister(uuid NetworkServerUUID) error

type NetworkServerUUID

type NetworkServerUUID string
const (
	UUID_NETWORK_SERVER_NAP  NetworkServerUUID = "nap"
	UUID_NETWORK_SERVER_PANU NetworkServerUUID = "panu"
	UUID_NETWORK_SERVER_GN   NetworkServerUUID = "gn"
)

type ProfileManager1

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

func ProfileManager

func ProfileManager() (res *ProfileManager1, err error)

func (*ProfileManager1) Close

func (pm *ProfileManager1) Close()

func (*ProfileManager1) RegisterProfile

func (pm *ProfileManager1) RegisterProfile(profilePath dbus.ObjectPath, UUID string, options DBusBluezProfileOptions) error

func (*ProfileManager1) UnregisterProfile

func (pm *ProfileManager1) UnregisterProfile(profilePath dbus.ObjectPath) error

Jump to

Keyboard shortcuts

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