Documentation ¶
Index ¶
- Constants
- Variables
- func AdapterNameToDBusPath(adapterName string) dbus.ObjectPath
- func RegisterDefaultAgent(agent Agent1Interface, caps AgentCapability) (err error)
- func UnregisterAgent(path string) (err error)
- type Adapter1
- func (a *Adapter1) Close()
- func (a *Adapter1) GetAddress() (res net.HardwareAddr, err error)
- func (a *Adapter1) GetAddressType() (res string, err error)
- func (a *Adapter1) GetAlias() (res string, err error)
- func (a *Adapter1) GetClass() (res uint32, err error)
- func (a *Adapter1) GetDiscoverable() (res bool, err error)
- func (a *Adapter1) GetDiscoverableTimeout() (res uint32, err error)
- func (a *Adapter1) GetDiscovering() (res bool, err error)
- func (a *Adapter1) GetModalias() (res string, err error)
- func (a *Adapter1) GetName() (res string, err error)
- func (a *Adapter1) GetPairable() (res bool, err error)
- func (a *Adapter1) GetPairableTimeout() (res uint32, err error)
- func (a *Adapter1) GetPowered() (res bool, err error)
- func (a *Adapter1) GetUUIDs() (res []string, err error)
- func (a *Adapter1) SetAlias(val string) (err error)
- func (a *Adapter1) SetDiscoverable(val bool) (err error)
- func (a *Adapter1) SetDiscoverableTimeout(val uint32) (err error)
- func (a *Adapter1) SetPairable(val bool) (err error)
- func (a *Adapter1) SetPairableTimeout(val uint32) (err error)
- func (a *Adapter1) SetPowered(val bool) (err error)
- func (a *Adapter1) StartDiscovery() error
- func (a *Adapter1) StopDiscovery() error
- type Agent1Interface
- type AgentCapability
- type AgentManager1
- func (am *AgentManager1) Close()
- func (a *AgentManager1) ExportGoAgentToDBus(agentInstance Agent1Interface, targetPath dbus.ObjectPath) error
- func (a *AgentManager1) RegisterAgent(agentPath dbus.ObjectPath, capability AgentCapability) error
- func (a *AgentManager1) RequestDefaultAgent(agentPath dbus.ObjectPath) error
- func (a *AgentManager1) UnregisterAgent(agentPath dbus.ObjectPath) error
- type DBusBluezProfileOptions
- type Device1
- func (d *Device1) CancelPairing() error
- func (d *Device1) Close()
- func (d *Device1) Connect() error
- func (d *Device1) ConnectProfile(uuid string) error
- func (d *Device1) Disconnect() error
- func (d *Device1) DisconnectProfile(uuid string) error
- func (d *Device1) GetAddress() (res net.HardwareAddr, err error)
- func (d *Device1) GetAddressType() (res string, err error)
- func (d *Device1) GetAlias() (res string, err error)
- func (d *Device1) GetBlocked() (res bool, err error)
- func (d *Device1) GetConnected() (res bool, err error)
- func (d *Device1) GetPaired() (res bool, err error)
- func (d *Device1) GetPath() dbus.ObjectPath
- func (d *Device1) GetTrusted() (res bool, err error)
- func (d *Device1) Pair() error
- func (d *Device1) SetAlias(val string) (err error)
- func (d *Device1) SetBlocked(val bool) (err error)
- func (d *Device1) SetTrusted(val bool) (err error)
- type Network1
- type NetworkServer1
- type NetworkServerUUID
- type ProfileManager1
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 ¶
Types ¶
type Adapter1 ¶
type Adapter1 struct {
// contains filtered or unexported fields
}
func (*Adapter1) GetAddress ¶
func (a *Adapter1) GetAddress() (res net.HardwareAddr, err error)
Properties
func (*Adapter1) GetAddressType ¶
func (*Adapter1) GetDiscoverable ¶
func (*Adapter1) GetDiscoverableTimeout ¶
func (*Adapter1) GetDiscovering ¶
func (*Adapter1) GetModalias ¶
func (*Adapter1) GetPairable ¶
func (*Adapter1) GetPairableTimeout ¶
func (*Adapter1) GetPowered ¶
func (*Adapter1) SetDiscoverable ¶
func (*Adapter1) SetDiscoverableTimeout ¶
func (*Adapter1) SetPairable ¶
func (*Adapter1) SetPairableTimeout ¶
func (*Adapter1) SetPowered ¶
func (*Adapter1) StartDiscovery ¶
func (*Adapter1) StopDiscovery ¶
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 Device1 ¶
type Device1 struct {
// contains filtered or unexported fields
}
func (*Device1) CancelPairing ¶
func (*Device1) ConnectProfile ¶
func (*Device1) Disconnect ¶
func (*Device1) DisconnectProfile ¶
func (*Device1) GetAddress ¶
func (d *Device1) GetAddress() (res net.HardwareAddr, err error)
func (*Device1) GetAddressType ¶
func (*Device1) GetBlocked ¶
func (*Device1) GetConnected ¶
func (*Device1) GetPath ¶
func (d *Device1) GetPath() dbus.ObjectPath
func (*Device1) SetBlocked ¶
func (*Device1) SetTrusted ¶
type Network1 ¶
type Network1 struct {
// contains filtered or unexported fields
}
Network1
func (*Network1) Connect ¶
func (a *Network1) Connect(uuid NetworkServerUUID) error
Valid UUIDs are "gn", "panu" or "nap".
func (*Network1) Disconnect ¶
func (*Network1) GetConnected ¶
func (*Network1) GetInterface ¶
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
Click to show internal directories.
Click to hide internal directories.