Documentation
¶
Overview ¶
BlueZ D-Bus Network API description [network-api.txt]
Index ¶
- Variables
- type Network1
- func (a *Network1) Client() *bluez.Client
- func (a *Network1) Close()
- func (a *Network1) Connect(uuid string) (string, error)
- func (a *Network1) Disconnect() error
- func (a *Network1) GetConnected() (bool, error)
- func (a *Network1) GetInterface() (string, error)
- func (a *Network1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)
- func (a *Network1) GetProperties() (*Network1Properties, error)
- func (a *Network1) GetPropertiesSignal() (chan *dbus.Signal, error)
- func (a *Network1) GetProperty(name string) (dbus.Variant, error)
- func (a *Network1) GetUUID() (string, error)
- func (a *Network1) Interface() string
- func (a *Network1) Path() dbus.ObjectPath
- func (a *Network1) SetProperty(name string, value interface{}) error
- func (a *Network1) ToProps() bluez.Properties
- func (a *Network1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
- func (a *Network1) WatchProperties() (chan *bluez.PropertyChanged, error)
- type Network1Properties
- func (a *Network1Properties) FromDBusMap(props map[string]dbus.Variant) (*Network1Properties, error)
- func (a *Network1Properties) FromMap(props map[string]interface{}) (*Network1Properties, error)
- func (p *Network1Properties) Lock()
- func (a *Network1Properties) ToMap() (map[string]interface{}, error)
- func (p *Network1Properties) Unlock()
- type NetworkServer1
- func (a *NetworkServer1) Client() *bluez.Client
- func (a *NetworkServer1) Close()
- func (a *NetworkServer1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)
- func (a *NetworkServer1) GetProperties() (*NetworkServer1Properties, error)
- func (a *NetworkServer1) GetPropertiesSignal() (chan *dbus.Signal, error)
- func (a *NetworkServer1) GetProperty(name string) (dbus.Variant, error)
- func (a *NetworkServer1) Interface() string
- func (a *NetworkServer1) Path() dbus.ObjectPath
- func (a *NetworkServer1) Register(uuid string, bridge string) error
- func (a *NetworkServer1) SetProperty(name string, value interface{}) error
- func (a *NetworkServer1) ToProps() bluez.Properties
- func (a *NetworkServer1) Unregister(uuid string) error
- func (a *NetworkServer1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
- func (a *NetworkServer1) WatchProperties() (chan *bluez.PropertyChanged, error)
- type NetworkServer1Properties
- func (a *NetworkServer1Properties) FromDBusMap(props map[string]dbus.Variant) (*NetworkServer1Properties, error)
- func (a *NetworkServer1Properties) FromMap(props map[string]interface{}) (*NetworkServer1Properties, error)
- func (p *NetworkServer1Properties) Lock()
- func (a *NetworkServer1Properties) ToMap() (map[string]interface{}, error)
- func (p *NetworkServer1Properties) Unlock()
Constants ¶
This section is empty.
Variables ¶
var Network1Interface = "org.bluez.Network1"
var NetworkServer1Interface = "org.bluez.NetworkServer1"
Functions ¶
This section is empty.
Types ¶
type Network1 ¶
type Network1 struct { Properties *Network1Properties // contains filtered or unexported fields }
Network1 Network hierarchy
func NewNetwork1 ¶
func NewNetwork1(objectPath dbus.ObjectPath) (*Network1, error)
NewNetwork1 create a new instance of Network1
Args: - objectPath: [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX
func (*Network1) Connect ¶
Connect
Connect to the network device and return the network interface name. Examples of the interface name are bnep0, bnep1 etc. uuid can be either one of "gn", "panu" or "nap" (case insensitive) or a traditional string representation of UUID or a hexadecimal number. The connection will be closed and network device
func (*Network1) Disconnect ¶
Disconnect
Disconnect from the network device. To abort a connection attempt in case of errors or timeouts in the client it is fine to call this method. Possible errors: org.bluez.Error.Failed
func (*Network1) GetConnected ¶
GetConnected get Connected value
func (*Network1) GetInterface ¶
GetInterface get Interface value
func (*Network1) GetObjectManagerSignal ¶
GetObjectManagerSignal return a channel for receiving updates from the ObjectManager
func (*Network1) GetProperties ¶
func (a *Network1) GetProperties() (*Network1Properties, error)
GetProperties load all available properties
func (*Network1) GetPropertiesSignal ¶
GetPropertiesSignal return a channel for receiving udpdates on property changes
func (*Network1) GetProperty ¶
GetProperty get a property
func (*Network1) SetProperty ¶
SetProperty set a property
func (*Network1) ToProps ¶
func (a *Network1) ToProps() bluez.Properties
ToProps return the properties interface
func (*Network1) UnwatchProperties ¶
func (a *Network1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
func (*Network1) WatchProperties ¶
func (a *Network1) WatchProperties() (chan *bluez.PropertyChanged, error)
WatchProperties updates on property changes
type Network1Properties ¶
type Network1Properties struct { /* Connected Indicates if the device is connected. */ Connected bool /* Interface Indicates the network interface name when available. */ Interface string /* UUID Indicates the connection role when available. */ UUID string // contains filtered or unexported fields }
Network1Properties contains the exposed properties of an interface
func (*Network1Properties) FromDBusMap ¶
func (a *Network1Properties) FromDBusMap(props map[string]dbus.Variant) (*Network1Properties, error)
FromDBusMap convert a map to an Network1Properties
func (*Network1Properties) FromMap ¶
func (a *Network1Properties) FromMap(props map[string]interface{}) (*Network1Properties, error)
FromMap convert a map to an Network1Properties
func (*Network1Properties) ToMap ¶
func (a *Network1Properties) ToMap() (map[string]interface{}, error)
ToMap convert a Network1Properties to map
func (*Network1Properties) Unlock ¶
func (p *Network1Properties) Unlock()
Unlock access to properties
type NetworkServer1 ¶
type NetworkServer1 struct { Properties *NetworkServer1Properties // contains filtered or unexported fields }
NetworkServer1 Network server hierarchy
func NewNetworkServer1 ¶
func NewNetworkServer1(objectPath dbus.ObjectPath) (*NetworkServer1, error)
NewNetworkServer1 create a new instance of NetworkServer1
Args: - objectPath: /org/bluez/{hci0,hci1,...}
func (*NetworkServer1) Client ¶
func (a *NetworkServer1) Client() *bluez.Client
Client return NetworkServer1 dbus client
func (*NetworkServer1) GetObjectManagerSignal ¶
func (a *NetworkServer1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)
GetObjectManagerSignal return a channel for receiving updates from the ObjectManager
func (*NetworkServer1) GetProperties ¶
func (a *NetworkServer1) GetProperties() (*NetworkServer1Properties, error)
GetProperties load all available properties
func (*NetworkServer1) GetPropertiesSignal ¶
func (a *NetworkServer1) GetPropertiesSignal() (chan *dbus.Signal, error)
GetPropertiesSignal return a channel for receiving udpdates on property changes
func (*NetworkServer1) GetProperty ¶
func (a *NetworkServer1) GetProperty(name string) (dbus.Variant, error)
GetProperty get a property
func (*NetworkServer1) Interface ¶
func (a *NetworkServer1) Interface() string
Interface return NetworkServer1 interface
func (*NetworkServer1) Path ¶
func (a *NetworkServer1) Path() dbus.ObjectPath
Path return NetworkServer1 object path
func (*NetworkServer1) Register ¶
func (a *NetworkServer1) Register(uuid string, bridge string) error
Register
Register server for the provided UUID. Every new connection to this server will be added the bridge interface. Valid UUIDs are "gn", "panu" or "nap". Initially no network server SDP is provided. Only after this method a SDP record will be available and the BNEP server will be ready for incoming connections.
func (*NetworkServer1) SetProperty ¶
func (a *NetworkServer1) SetProperty(name string, value interface{}) error
SetProperty set a property
func (*NetworkServer1) ToProps ¶
func (a *NetworkServer1) ToProps() bluez.Properties
ToProps return the properties interface
func (*NetworkServer1) Unregister ¶
func (a *NetworkServer1) Unregister(uuid string) error
Unregister
Unregister the server for provided UUID. All servers will be automatically unregistered when the calling application terminates.
func (*NetworkServer1) UnwatchProperties ¶
func (a *NetworkServer1) UnwatchProperties(ch chan *bluez.PropertyChanged) error
func (*NetworkServer1) WatchProperties ¶
func (a *NetworkServer1) WatchProperties() (chan *bluez.PropertyChanged, error)
WatchProperties updates on property changes
type NetworkServer1Properties ¶
type NetworkServer1Properties struct {
// contains filtered or unexported fields
}
NetworkServer1Properties contains the exposed properties of an interface
func (*NetworkServer1Properties) FromDBusMap ¶
func (a *NetworkServer1Properties) FromDBusMap(props map[string]dbus.Variant) (*NetworkServer1Properties, error)
FromDBusMap convert a map to an NetworkServer1Properties
func (*NetworkServer1Properties) FromMap ¶
func (a *NetworkServer1Properties) FromMap(props map[string]interface{}) (*NetworkServer1Properties, error)
FromMap convert a map to an NetworkServer1Properties
func (*NetworkServer1Properties) Lock ¶
func (p *NetworkServer1Properties) Lock()
Lock access to properties
func (*NetworkServer1Properties) ToMap ¶
func (a *NetworkServer1Properties) ToMap() (map[string]interface{}, error)
ToMap convert a NetworkServer1Properties to map
func (*NetworkServer1Properties) Unlock ¶
func (p *NetworkServer1Properties) Unlock()
Unlock access to properties