profile

package
v0.0.0-...-f9b8134 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AGENT_CAP_DISPLAY_ONLY       = "DisplayOnly"
	AGENT_CAP_DISPLAY_YES_NO     = "DisplayYesNo"
	AGENT_CAP_KEYBOARD_ONLY      = "KeyboardOnly"
	AGENT_CAP_NO_INPUT_NO_OUTPUT = "NoInputNoOutput"
	AGENT_CAP_KEYBOARD_DISPLAY   = "KeyboardDisplay"
)

All agent capabilities

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter1

type Adapter1 struct {
	Properties *Adapter1Properties
	// contains filtered or unexported fields
}

Adapter1 client

func NewAdapter1

func NewAdapter1(hostID string) *Adapter1

NewAdapter1 create a new Adapter1 client

func (*Adapter1) Close

func (a *Adapter1) Close()

Close the connection

func (*Adapter1) GetDiscoveryFilters

func (a *Adapter1) GetDiscoveryFilters() ([]string, error)

GetDiscoveryFilters - get supported discovery filters

func (*Adapter1) GetProperties

func (a *Adapter1) GetProperties() (*Adapter1Properties, error)

GetProperties load all available properties

func (*Adapter1) RemoveDevice

func (a *Adapter1) RemoveDevice(device string) error

RemoveDevice from the list

func (*Adapter1) SetDiscoveryFilter

func (a *Adapter1) SetDiscoveryFilter(f map[string]interface{}) error

SetDiscoveryFilters - set discovery filters.

Example:

	filters := map[string]interface{} {
		"RSSI": int16(-127),
		"Transport": "le",
		"DuplicateData": true,
		"UUIDs": []string{"0x180a", "0x1400"},
	}
 adapter.SetDiscoveryFilter(filter)

func (*Adapter1) SetProperty

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

SetProperty set a property

func (*Adapter1) StartDiscovery

func (a *Adapter1) StartDiscovery() error

StartDiscovery on the adapter

func (*Adapter1) StopDiscovery

func (a *Adapter1) StopDiscovery() error

StopDiscovery on the adapter

type Adapter1Properties

type Adapter1Properties struct {
	UUIDs               []string
	Discoverable        bool
	Discovering         bool
	Pairable            bool
	Powered             bool
	Address             string
	AddressType         string
	Alias               string
	Modalias            string
	Name                string
	Class               uint32
	DiscoverableTimeout uint32
	PairableTimeout     uint32
}

Adapter1Properties contains the exposed properties of an interface

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
	InterfacePath() string
}

type AgentManager1

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

AgentManager1 client

func NewAgentManager1

func NewAgentManager1(hostID string) *AgentManager1

NewAgentManager1 create a new AgentManager1 client

func (*AgentManager1) Close

func (a *AgentManager1) Close()

Close the connection

func (*AgentManager1) ExportGoAgentToDBus

func (a *AgentManager1) ExportGoAgentToDBus(agentInstance Agent1Interface) error

ExportGoAgentToDBus exports the xml of go agent to dbus

func (*AgentManager1) RegisterAgent

func (a *AgentManager1) RegisterAgent(agent string, capability string) error

RegisterAgent registers an agent handler

func (*AgentManager1) RequestDefaultAgent

func (a *AgentManager1) RequestDefaultAgent(agent string) error

RequestDefaultAgent requests to make the application agent the default agent

func (*AgentManager1) UnregisterAgent

func (a *AgentManager1) UnregisterAgent(agent string) error

UnregisterAgent unregisters the agent that has been previously registered

type Device1

type Device1 struct {
	Properties *Device1Properties
	// contains filtered or unexported fields
}

Device1 client

func NewDevice1

func NewDevice1(path string) *Device1

NewDevice1 create a new Device1 client

func (*Device1) CancelPairing

func (d *Device1) CancelPairing() error

CancelParing stop the pairing process

func (*Device1) Close

func (d *Device1) Close()

Close the connection

func (*Device1) Connect

func (d *Device1) Connect() error

Connect to the device

func (*Device1) ConnectProfile

func (d *Device1) ConnectProfile(uuid string) error

ConnectProfile connect to the specific profile

func (*Device1) Disconnect

func (d *Device1) Disconnect() error

Disconnect from the device

func (*Device1) DisconnectProfile

func (d *Device1) DisconnectProfile(uuid string) error

DisconnectProfile from the device

func (*Device1) GetProperties

func (d *Device1) GetProperties() (*Device1Properties, error)

GetProperties load all available properties

func (*Device1) GetProperty

func (d *Device1) GetProperty(name string) (dbus.Variant, error)

GetProperty get a property

func (*Device1) Pair

func (d *Device1) Pair() error

Pair with the device

func (*Device1) Register

func (d *Device1) Register() (chan *dbus.Signal, error)

Register for changes signalling

func (*Device1) SetProperty

func (d *Device1) SetProperty(name string, v interface{}) error

SetProperty set a property

func (*Device1) Unregister

func (d *Device1) Unregister(signal chan *dbus.Signal) error

Unregister for changes signalling

type Device1Properties

type Device1Properties struct {
	Lock             sync.RWMutex
	AdvertisingFlags []byte
	UUIDs            []string
	Blocked          bool
	Connected        bool
	LegacyPairing    bool
	Paired           bool
	ServicesResolved bool
	Trusted          bool
	ServiceData      map[string]dbus.Variant
	ManufacturerData map[uint16]dbus.Variant
	RSSI             int16
	TxPower          int16
	Adapter          dbus.ObjectPath
	Address          string
	AddressType      string
	Alias            string
	Icon             string
	Modalias         string
	Name             string
	Appearance       uint16
	Class            uint32
}

Device1Properties exposed properties for Device1

type GattCharacteristic1

type GattCharacteristic1 struct {
	Properties *GattCharacteristic1Properties

	Path string
	// contains filtered or unexported fields
}

GattCharacteristic1 client

func NewGattCharacteristic1

func NewGattCharacteristic1(path string) (*GattCharacteristic1, error)

NewGattCharacteristic1 create a new GattCharacteristic1 client

func (*GattCharacteristic1) AcquireNotify

func (d *GattCharacteristic1) AcquireNotify() (dbus.UnixFD, uint16, error)

AcquireNotify acquire file descriptor and MTU for notify [experimental]

func (*GattCharacteristic1) AcquireWrite

func (d *GattCharacteristic1) AcquireWrite() (dbus.UnixFD, uint16, error)

AcquireWrite acquire file descriptor and MTU for writing [experimental]

func (*GattCharacteristic1) Close

func (d *GattCharacteristic1) Close()

Close the connection

func (*GattCharacteristic1) GetProperties

GetProperties load all available properties

func (*GattCharacteristic1) GetProperty

func (d *GattCharacteristic1) GetProperty(name string) (interface{}, error)

GetProperty load a single property

func (*GattCharacteristic1) ReadValue

func (d *GattCharacteristic1) ReadValue(options map[string]dbus.Variant) ([]byte, error)

ReadValue read a value from a characteristic

func (*GattCharacteristic1) Register

func (d *GattCharacteristic1) Register() (chan *dbus.Signal, error)

Register for changes signalling

func (*GattCharacteristic1) StartNotify

func (d *GattCharacteristic1) StartNotify() error

StartNotify start notifications

func (*GattCharacteristic1) StopNotify

func (d *GattCharacteristic1) StopNotify() error

StopNotify stop notifications

func (*GattCharacteristic1) Unregister

func (d *GattCharacteristic1) Unregister(signal chan *dbus.Signal) error

Unregister for changes signalling

func (*GattCharacteristic1) WriteValue

func (d *GattCharacteristic1) WriteValue(b []byte, options map[string]dbus.Variant) error

WriteValue write a value to a characteristic

type GattCharacteristic1Properties

type GattCharacteristic1Properties struct {
	Value          []byte `dbus:"emit"`
	Notifying      bool
	NotifyAcquired bool
	WriteAcquired  bool
	Service        dbus.ObjectPath
	UUID           string
	Flags          []string
	Descriptors    []dbus.ObjectPath
}

GattCharacteristic1Properties exposed properties for GattCharacteristic1

func (*GattCharacteristic1Properties) ToMap

func (d *GattCharacteristic1Properties) ToMap() (map[string]interface{}, error)

ToMap serialize properties

type GattDescriptor1

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

GattDescriptor1 client

func NewGattDescriptor1

func NewGattDescriptor1(path string) (*GattDescriptor1, error)

NewGattDescriptor1 create a new GattDescriptor1 client

func (*GattDescriptor1) Close

func (d *GattDescriptor1) Close()

Close the connection

func (*GattDescriptor1) GetProperties

func (d *GattDescriptor1) GetProperties() (*GattDescriptor1Properties, error)

GetProperties load all available properties

func (*GattDescriptor1) ReadValue

func (d *GattDescriptor1) ReadValue(options map[string]dbus.Variant) ([]byte, error)

ReadValue read a value from a descriptor

func (*GattDescriptor1) Register

func (d *GattDescriptor1) Register() (chan *dbus.Signal, error)

Register for changes signalling

func (*GattDescriptor1) Unregister

func (d *GattDescriptor1) Unregister(signal chan *dbus.Signal) error

Unregister for changes signalling

func (*GattDescriptor1) WriteValue

func (d *GattDescriptor1) WriteValue(b []byte, options map[string]dbus.Variant) error

WriteValue write a value to a characteristic

type GattDescriptor1Properties

type GattDescriptor1Properties struct {
	Value          []byte `dbus:"emit"`
	Characteristic dbus.ObjectPath
	UUID           string
	Flags          []string
}

GattDescriptor1Properties exposed properties for GattDescriptor1

func (*GattDescriptor1Properties) ToMap

func (d *GattDescriptor1Properties) ToMap() (map[string]interface{}, error)

ToMap serialize properties

type GattManager1

type GattManager1 struct {
	Properties *GattManager1Properties
	// contains filtered or unexported fields
}

GattManager1 client

func NewGattManager1

func NewGattManager1(hostID string) *GattManager1

NewGattManager1 create a new GattManager1 client

func (*GattManager1) Close

func (a *GattManager1) Close()

Close the connection

func (*GattManager1) GetProperties

func (a *GattManager1) GetProperties() (*GattManager1Properties, error)

GetProperties load all available properties

func (*GattManager1) RegisterApplication

func (a *GattManager1) RegisterApplication(app dbus.ObjectPath, options map[string]interface{}) error

RegisterApplication add a new bluetooth Application

func (*GattManager1) UnregisterApplication

func (a *GattManager1) UnregisterApplication(app dbus.ObjectPath) error

UnregisterApplication remove a bluetooth Application

type GattManager1Properties

type GattManager1Properties struct {
}

GattManager1Properties exposed properties for GattManager1

type GattService1

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

GattService1 client

func NewGattService1

func NewGattService1(path string, name string) *GattService1

NewGattService1 create a new GattService1 client

func (*GattService1) Close

func (d *GattService1) Close()

Close the connection

func (*GattService1) GetProperties

func (d *GattService1) GetProperties() (*GattService1Properties, error)

GetProperties load all available properties

func (*GattService1) Register

func (d *GattService1) Register() (chan *dbus.Signal, error)

Register for changes signalling

func (*GattService1) Unregister

func (d *GattService1) Unregister(signal chan *dbus.Signal) error

Unregister for changes signalling

type GattService1Properties

type GattService1Properties struct {
	Primary         bool
	Device          dbus.ObjectPath
	Characteristics []dbus.ObjectPath `dbus:"emit"`
	UUID            string
}

GattService1Properties exposed properties for GattService1

func (*GattService1Properties) ToMap

func (p *GattService1Properties) ToMap() (map[string]interface{}, error)

ToMap serialize a properties struct to a map

type LEAdvertisement1Properties

type LEAdvertisement1Properties struct {
	Type             string
	ServiceUUIDs     []string
	ManufacturerData map[string]interface{}
	SolicitUUIDs     []string
	ServiceData      map[string]interface{}
	Data             map[string]interface{}
	// Advertise as general discoverable. When present this
	// will override adapter Discoverable property.
	//
	// Note: This property shall not be set when Type is set
	// to broadcast.
	Discoverable        bool
	DiscoverableTimeout uint16
	// List of features to be included in the advertising
	// packet.
	//
	// Possible values: as found on
	// 		LEAdvertisingManager.SupportedIncludes
	Includes   []string
	LocalName  string
	Appearance uint16
	Duration   uint16
	Timeout    uint16
}

LEAdvertisement1Properties exposed properties for LEAdvertisement1

func (*LEAdvertisement1Properties) ToMap

func (d *LEAdvertisement1Properties) ToMap() (map[string]interface{}, error)

ToMap serialize properties

type LEAdvertisingManager1

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

LEAdvertisingManager1 client

func NewLEAdvertisingManager1

func NewLEAdvertisingManager1(hostID string) *LEAdvertisingManager1

NewLEAdvertisingManager1 create a new LEAdvertisingManager1 client

func (*LEAdvertisingManager1) Close

func (a *LEAdvertisingManager1) Close()

Close the connection

func (*LEAdvertisingManager1) RegisterAdvertisement

func (a *LEAdvertisingManager1) RegisterAdvertisement(advertisement string, options map[string]interface{}) error

RegisterAdvertisement add a new advertisement service

func (*LEAdvertisingManager1) UnregisterAdvertisement

func (a *LEAdvertisingManager1) UnregisterAdvertisement(advertisement string) error

UnregisterAdvertisement drop an advertisement service

type LEAdvertisingManager1Properties

type LEAdvertisingManager1Properties struct {
	ActiveInstances    byte
	SupportedInstances byte
	SupportedIncludes  []SupportedIncludesType
}

LEAdvertisingManager1Properties exposed properties for LEAdvertisingManager1

type ObjectManager

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

ObjectManager manges the list of all available objects

func NewObjectManager

func NewObjectManager(name string, path string) *ObjectManager

NewObjectManager create a new Device1 client

func (*ObjectManager) Close

func (o *ObjectManager) Close()

Close the connection

func (*ObjectManager) GetManagedObjects

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

GetManagedObjects return a list of all available objects registered

func (*ObjectManager) Register

func (o *ObjectManager) Register() (chan *dbus.Signal, error)

Register watch for signal events

func (*ObjectManager) Unregister

func (o *ObjectManager) Unregister(signal chan *dbus.Signal) error

Unregister watch for signal events

type ProfileManager1

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

ProfileManager1 client

func NewProfileManager1

func NewProfileManager1(hostID string) *ProfileManager1

NewProfileManager1 create a new ProfileManager1 client

func (*ProfileManager1) Close

func (a *ProfileManager1) Close()

Close the connection

func (*ProfileManager1) RegisterProfile

func (a *ProfileManager1) RegisterProfile(profile string, UUID string, options map[string]interface{}) error

RegisterProfile add a new Profile for an UUID

func (*ProfileManager1) UnregisterProfile

func (a *ProfileManager1) UnregisterProfile(profile string) error

UnregisterProfile add a new Profile for an UUID

type SupportedIncludesType

type SupportedIncludesType string
const (
	SupportedIncludesTypeTxPower    SupportedIncludesType = "tx-power"
	SupportedIncludesTypeAppearance SupportedIncludesType = "appearance"
	SupportedIncludesTypeLocalName  SupportedIncludesType = "local-name"
)

Possible values: "tx-power" "appearance" "local-name"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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