service

package
v0.0.0-...-6ac6c84 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const UUIDSuffix = "-0000-1000-8000-00805F9B34FB"

UUIDSuffix fixed 128bit UUID [0000]+[xxxx]+[-0000-1000-8000-00805F9B34FB]

Variables

View Source
var DbusErr = dbus.NewError("org.freedesktop.Dbus.Error", nil)

DbusErr a generic dbus Error

View Source
var DbusErrIfaceNotFound = prop.ErrIfaceNotFound

DbusErrIfaceNotFound interface not found

View Source
var DbusErrPropNotFound = prop.ErrPropNotFound

DbusErrPropNotFound property not found

Functions

This section is empty.

Types

type Application

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

Application a bluetooth service exposed by bluez

func NewApplication

func NewApplication(config *ApplicationConfig) (*Application, error)

NewApplication instantiate a new application service

func (*Application) AddService

func (app *Application) AddService(service *GattService1) error

AddService add service to expose

func (*Application) CreateService

func (app *Application) CreateService(props *profile.GattService1Properties) (*GattService1, error)

CreateService create a new GattService1 instance

func (*Application) GenerateUUID

func (app *Application) GenerateUUID(uuidVal string) string

GenerateUUID generate a 128bit UUID

func (*Application) GetObjectManager

func (app *Application) GetObjectManager() *ObjectManager

GetObjectManager return the object manager interface handler

func (*Application) GetServices

func (app *Application) GetServices() map[dbus.ObjectPath]*GattService1

GetServices return the registered services

func (*Application) Name

func (app *Application) Name() string

Name return the object name

func (*Application) Path

func (app *Application) Path() dbus.ObjectPath

Path return the object path

func (*Application) RemoveService

func (app *Application) RemoveService(service *GattService1) error

RemoveService remove an exposed service

func (*Application) Run

func (app *Application) Run() error

Run start the application

type ApplicationConfig

type ApplicationConfig struct {
	UUIDSuffix string
	UUID       string

	ObjectName string
	ObjectPath dbus.ObjectPath
	// contains filtered or unexported fields
}

ApplicationConfig configuration for the bluetooth service

type GattCharacteristic1

type GattCharacteristic1 struct {
	PropertiesInterface *Properties
	// contains filtered or unexported fields
}

GattCharacteristic1 client

func NewGattCharacteristic1

NewGattCharacteristic1 create a new GattCharacteristic1 client

func (*GattCharacteristic1) AddDescriptor

func (s *GattCharacteristic1) AddDescriptor(desc *GattDescriptor1) error

AddDescriptor add a characteristic

func (*GattCharacteristic1) CreateDescriptor

CreateDescriptor create a new characteristic

func (*GattCharacteristic1) Expose

func (s *GattCharacteristic1) Expose() error

Expose the char to dbus

func (*GattCharacteristic1) GetDescriptorPaths

func (s *GattCharacteristic1) GetDescriptorPaths() []dbus.ObjectPath

GetDescriptorPaths return the characteristics object paths

func (*GattCharacteristic1) GetDescriptors

func (s *GattCharacteristic1) GetDescriptors() map[dbus.ObjectPath]*GattDescriptor1

GetDescriptors return the characteristics of the service

func (*GattCharacteristic1) Interface

func (s *GattCharacteristic1) Interface() string

Interface return the dbus interface name

func (*GattCharacteristic1) Path

Path return the object path

func (*GattCharacteristic1) Properties

func (s *GattCharacteristic1) Properties() map[string]bluez.Properties

Properties return the properties of the service

func (*GattCharacteristic1) ReadValue

func (s *GattCharacteristic1) ReadValue(options map[string]interface{}) []byte

ReadValue read a value

func (*GattCharacteristic1) RemoveDescriptor

func (s *GattCharacteristic1) RemoveDescriptor(char *GattDescriptor1) error

RemoveDescriptor remove a characteristic

func (*GattCharacteristic1) StartNotify

func (s *GattCharacteristic1) StartNotify() error

StartNotify start notification

func (*GattCharacteristic1) StopNotify

func (s *GattCharacteristic1) StopNotify() error

StopNotify stop notification

func (*GattCharacteristic1) WriteValue

func (s *GattCharacteristic1) WriteValue(value []byte, options map[string]interface{})

WriteValue write a value

type GattCharacteristic1Config

type GattCharacteristic1Config struct {
	ID int
	// contains filtered or unexported fields
}

GattCharacteristic1Config GattCharacteristic1 configuration

type GattDescriptor1

type GattDescriptor1 struct {
	PropertiesInterface *Properties
	// contains filtered or unexported fields
}

GattDescriptor1 client

func NewGattDescriptor1

func NewGattDescriptor1(config *GattDescriptor1Config, props *profile.GattDescriptor1Properties) (*GattDescriptor1, error)

NewGattDescriptor1 create a new GattDescriptor1 client

func (*GattDescriptor1) Expose

func (s *GattDescriptor1) Expose() error

Expose the desc to dbus

func (*GattDescriptor1) Interface

func (s *GattDescriptor1) Interface() string

Interface return the Dbus interface

func (*GattDescriptor1) Path

func (s *GattDescriptor1) Path() dbus.ObjectPath

Path return the object path

func (*GattDescriptor1) Properties

func (s *GattDescriptor1) Properties() map[string]bluez.Properties

Properties return the properties of the service

func (*GattDescriptor1) ReadValue

func (s *GattDescriptor1) ReadValue(options map[string]interface{}) []byte

ReadValue read a value

func (*GattDescriptor1) WriteValue

func (s *GattDescriptor1) WriteValue(value []byte, options map[string]interface{})

WriteValue write a value

type GattDescriptor1Config

type GattDescriptor1Config struct {
	ID int
	// contains filtered or unexported fields
}

GattDescriptor1Config GattDescriptor1 configuration

type GattService1

type GattService1 struct {
	PropertiesInterface *Properties
	// contains filtered or unexported fields
}

GattService1 interface implementation

func NewGattService1

func NewGattService1(config *GattService1Config, props *profile.GattService1Properties) (*GattService1, error)

NewGattService1 create a new instance of GattService1

func (*GattService1) AddCharacteristic

func (s *GattService1) AddCharacteristic(char *GattCharacteristic1) error

AddCharacteristic add a characteristic

func (*GattService1) CreateCharacteristic

func (s *GattService1) CreateCharacteristic(props *profile.GattCharacteristic1Properties) (*GattCharacteristic1, error)

CreateCharacteristic create a new characteristic

func (*GattService1) Expose

func (s *GattService1) Expose() error

Expose the service to dbus

func (*GattService1) GetApp

func (s *GattService1) GetApp() *Application

GetApp return the parent app

func (*GattService1) GetCharacteristicPaths

func (s *GattService1) GetCharacteristicPaths() []dbus.ObjectPath

GetCharacteristicPaths return the characteristics object paths

func (*GattService1) GetCharacteristics

func (s *GattService1) GetCharacteristics() map[dbus.ObjectPath]*GattCharacteristic1

GetCharacteristics return the characteristics of the service

func (*GattService1) Interface

func (s *GattService1) Interface() string

Interface return the dbus interface name

func (*GattService1) Path

func (s *GattService1) Path() dbus.ObjectPath

Path return the object path

func (*GattService1) Properties

func (s *GattService1) Properties() map[string]bluez.Properties

Properties return the properties of the service

func (*GattService1) RemoveCharacteristic

func (s *GattService1) RemoveCharacteristic(char *GattCharacteristic1) error

RemoveCharacteristic remove a characteristic

type GattService1Config

type GattService1Config struct {
	ID int
	// contains filtered or unexported fields
}

GattService1Config GattService configuration

type ObjectManager

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

ObjectManager interface implementation

func NewObjectManager

func NewObjectManager(conn *dbus.Conn) (*ObjectManager, error)

NewObjectManager create a new instance

func (*ObjectManager) AddObject

func (o *ObjectManager) AddObject(path dbus.ObjectPath, val map[string]bluez.Properties) error

AddObject add an object to the list

func (*ObjectManager) GetManagedObject

func (o *ObjectManager) GetManagedObject(objpath dbus.ObjectPath) (map[string]map[string]dbus.Variant, error)

GetManagedObject return an up to date view of a single object state

func (*ObjectManager) GetManagedObjects

func (o *ObjectManager) GetManagedObjects() (map[dbus.ObjectPath]map[string]map[string]dbus.Variant, *dbus.Error)

GetManagedObjects return an up to date view of the object state

func (*ObjectManager) RemoveObject

func (o *ObjectManager) RemoveObject(path dbus.ObjectPath) error

RemoveObject remove an object from the list

func (*ObjectManager) SignalAdded

func (o *ObjectManager) SignalAdded(path dbus.ObjectPath) error

SignalAdded notify of interfaces being added

func (*ObjectManager) SignalRemoved

func (o *ObjectManager) SignalRemoved(path dbus.ObjectPath, ifaces []string) error

SignalRemoved notify of interfaces being removed

type Properties

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

Properties interface implementation

func NewProperties

func NewProperties(conn *dbus.Conn) (*Properties, error)

NewProperties create a new instance

func (*Properties) AddProperties

func (p *Properties) AddProperties(iface string, props bluez.Properties) error

AddProperties add a property set

func (*Properties) Expose

func (p *Properties) Expose(path dbus.ObjectPath)

Expose expose the properties interface

func (*Properties) Instance

func (p *Properties) Instance() *prop.Properties

Instance return the props instance

func (*Properties) Introspection

func (p *Properties) Introspection(iface string) []introspect.Property

Introspection return the props instance

func (*Properties) RemoveProperties

func (p *Properties) RemoveProperties(iface string)

RemoveProperties remove a property set

Jump to

Keyboard shortcuts

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