bluez

package
Version: v0.0.0-...-efdff95 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Device1Interface the bluez interface for Device1
	Device1Interface = "org.bluez.Device1"
	//Adapter1Interface the bluez interface for Adapter1
	Adapter1Interface = "org.bluez.Adapter1"
	//GattService1Interface the bluez interface for GattService1
	GattService1Interface = "org.bluez.GattService1"
	//GattCharacteristic1Interface the bluez interface for GattCharacteristic1
	GattCharacteristic1Interface = "org.bluez.GattCharacteristic1"
	//GattDescriptor1Interface the bluez interface for GattDescriptor1
	GattDescriptor1Interface = "org.bluez.GattDescriptor1"

	//InterfacesRemoved the DBus signal member for InterfacesRemoved
	InterfacesRemoved = "org.freedesktop.DBus.ObjectManager.InterfacesRemoved"
	//InterfacesAdded the DBus signal member for InterfacesAdded
	InterfacesAdded = "org.freedesktop.DBus.ObjectManager.InterfacesAdded"

	//PropertiesInterface the DBus properties interface
	PropertiesInterface = "org.freedesktop.DBus.Properties"
	//PropertiesChanged the DBus properties interface and member
	PropertiesChanged = "org.freedesktop.DBus.Properties.PropertiesChanged"
)

Variables

This section is empty.

Functions

func GetConnection

func GetConnection(connType BusType) (*dbus.Conn, error)

GetConnection get a DBus connection

Types

type BusType

type BusType int

BusType a type of DBus connection

const (
	// SessionBus uses the session bus
	SessionBus BusType = iota
	// SystemBus uses the system bus
	SystemBus
)

type Client

type Client struct {
	Config *Config
	// contains filtered or unexported fields
}

Client implement a DBus client

func NewClient

func NewClient(config *Config) *Client

NewClient create a new client

func (*Client) Call

func (c *Client) Call(method string, flags dbus.Flags, args ...interface{}) *dbus.Call

Call a DBus method

func (*Client) Connect

func (c *Client) Connect() error

Connect connects to DBus

func (*Client) Disconnect

func (c *Client) Disconnect()

Disconnect from DBus

func (*Client) GetProperties

func (c *Client) GetProperties(props interface{}) error

GetProperties load all the properties for an interface

func (*Client) GetProperty

func (c *Client) GetProperty(p string) (dbus.Variant, error)

GetProperty return a property value

func (*Client) Register

func (c *Client) Register(path string, iface string) (chan *dbus.Signal, error)

Register for signals

func (*Client) SetProperty

func (c *Client) SetProperty(p string, v interface{}) error

SetProperty set a property value

func (*Client) Unregister

func (c *Client) Unregister(path string, iface string) error

Unregister for signals

type Config

type Config struct {
	Name  string
	Iface string
	Path  string
	Bus   BusType
}

Config pass configuration to a DBUS client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL