network

package
v0.0.0-...-fc103a5 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

BlueZ D-Bus Network API description [network-api.txt]

Index

Constants

This section is empty.

Variables

View Source
var Network1Interface = "org.bluez.Network1"
View Source
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) Client

func (a *Network1) Client() *bluez.Client

Client return Network1 dbus client

func (*Network1) Close

func (a *Network1) Close()

Close the connection

func (*Network1) Connect

func (a *Network1) Connect(uuid string) (string, error)

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

func (a *Network1) Disconnect() error

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

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

GetConnected get Connected value

func (*Network1) GetInterface

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

GetInterface get Interface value

func (*Network1) GetObjectManagerSignal

func (a *Network1) GetObjectManagerSignal() (chan *dbus.Signal, func(), error)

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

func (a *Network1) GetPropertiesSignal() (chan *dbus.Signal, error)

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*Network1) GetProperty

func (a *Network1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*Network1) GetUUID

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

GetUUID get UUID value

func (*Network1) Interface

func (a *Network1) Interface() string

Interface return Network1 interface

func (*Network1) Path

func (a *Network1) Path() dbus.ObjectPath

Path return Network1 object path

func (*Network1) SetProperty

func (a *Network1) SetProperty(name string, value interface{}) error

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) Lock

func (p *Network1Properties) Lock()

Lock access to properties

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) Close

func (a *NetworkServer1) Close()

Close the connection

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

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

Jump to

Keyboard shortcuts

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