advertisement_monitor

package
v0.0.0-...-04c4f09 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

BlueZ D-Bus Advertisement Monitor API Description [advertisement-monitor-api.txt] This API allows an client to specify a job of monitoring advertisements by registering the root of hierarchy and then exposing advertisement monitors under the root with filtering conditions, thresholds of RSSI and timers of RSSI thresholds.

Once a monitoring job is activated by BlueZ, the client can expect to get notified on the targeted advertisements no matter if there is an ongoing discovery session (a discovery session is started/stopped with methods in org.bluez.Adapter1 interface).

Index

Constants

This section is empty.

Variables

View Source
var AdvertisementMonitor1Interface = "org.bluez.AdvertisementMonitor1"
View Source
var AdvertisementMonitorManager1Interface = "org.bluez.AdvertisementMonitorManager1"

Functions

This section is empty.

Types

type AdvertisementMonitor1

type AdvertisementMonitor1 struct {
	Properties *AdvertisementMonitor1Properties
	// contains filtered or unexported fields
}

AdvertisementMonitor1 Advertisement Monitor hierarchy

func NewAdvertisementMonitor1

func NewAdvertisementMonitor1(objectPath dbus.ObjectPath) (*AdvertisementMonitor1, error)

NewAdvertisementMonitor1 create a new instance of AdvertisementMonitor1

Args: - objectPath: freely definable

func (*AdvertisementMonitor1) Activate

func (a *AdvertisementMonitor1) Activate() error

Activate After a monitor was exposed, this gets called as a

signal for client to get acknowledged when a monitor
has been activated, so the client can expect to receive
calls on DeviceFound() or DeviceLost().

func (*AdvertisementMonitor1) Client

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

Client return AdvertisementMonitor1 dbus client

func (*AdvertisementMonitor1) Close

func (a *AdvertisementMonitor1) Close()

Close the connection

func (*AdvertisementMonitor1) DeviceFound

func (a *AdvertisementMonitor1) DeviceFound(device dbus.ObjectPath) error

DeviceFound This gets called to notify the client of finding the

targeted device. Once receiving the call, the client
should start to monitor the corresponding device to
retrieve the changes on RSSI and advertisement content.

func (*AdvertisementMonitor1) DeviceLost

func (a *AdvertisementMonitor1) DeviceLost(device dbus.ObjectPath) error

DeviceLost This gets called to notify the client of losing the

targeted device. Once receiving this call, the client
should stop monitoring the corresponding device.

func (*AdvertisementMonitor1) GetObjectManagerSignal

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

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*AdvertisementMonitor1) GetPatterns

func (a *AdvertisementMonitor1) GetPatterns() ([]Pattern, error)

GetPatterns get Patterns value

func (*AdvertisementMonitor1) GetProperties

GetProperties load all available properties

func (*AdvertisementMonitor1) GetPropertiesSignal

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

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*AdvertisementMonitor1) GetProperty

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

GetProperty get a property

func (*AdvertisementMonitor1) GetRSSIHighThreshold

func (a *AdvertisementMonitor1) GetRSSIHighThreshold() (int16, error)

GetRSSIHighThreshold get RSSIHighThreshold value

func (*AdvertisementMonitor1) GetRSSIHighTimeout

func (a *AdvertisementMonitor1) GetRSSIHighTimeout() (uint16, error)

GetRSSIHighTimeout get RSSIHighTimeout value

func (*AdvertisementMonitor1) GetRSSILowThreshold

func (a *AdvertisementMonitor1) GetRSSILowThreshold() (int16, error)

GetRSSILowThreshold get RSSILowThreshold value

func (*AdvertisementMonitor1) GetRSSILowTimeout

func (a *AdvertisementMonitor1) GetRSSILowTimeout() (uint16, error)

GetRSSILowTimeout get RSSILowTimeout value

func (*AdvertisementMonitor1) GetRSSISamplingPeriod

func (a *AdvertisementMonitor1) GetRSSISamplingPeriod() (uint16, error)

GetRSSISamplingPeriod get RSSISamplingPeriod value

func (*AdvertisementMonitor1) GetType

func (a *AdvertisementMonitor1) GetType() (string, error)

GetType get Type value

func (*AdvertisementMonitor1) GetWatchPropertiesChannel

func (a *AdvertisementMonitor1) GetWatchPropertiesChannel() chan *dbus.Signal

GetWatchPropertiesChannel return the dbus channel to receive properties interface

func (*AdvertisementMonitor1) Interface

func (a *AdvertisementMonitor1) Interface() string

Interface return AdvertisementMonitor1 interface

func (*AdvertisementMonitor1) Path

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

Path return AdvertisementMonitor1 object path

func (*AdvertisementMonitor1) Release

func (a *AdvertisementMonitor1) Release() error

Release This gets called as a signal for a client to perform

clean-up when (1)a monitor cannot be activated after it
was exposed or (2)a monitor has been deactivated.

func (*AdvertisementMonitor1) SetProperty

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

SetProperty set a property

func (*AdvertisementMonitor1) SetWatchPropertiesChannel

func (a *AdvertisementMonitor1) SetWatchPropertiesChannel(c chan *dbus.Signal)

SetWatchPropertiesChannel set the dbus channel to receive properties interface

func (*AdvertisementMonitor1) ToProps

func (a *AdvertisementMonitor1) ToProps() bluez.Properties

ToProps return the properties interface

func (*AdvertisementMonitor1) UnwatchProperties

func (a *AdvertisementMonitor1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*AdvertisementMonitor1) WatchProperties

func (a *AdvertisementMonitor1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type AdvertisementMonitor1Properties

type AdvertisementMonitor1Properties struct {

	/*
		Patterns If the Type property is set to "or_patterns", then this
				property must exist and have at least one entry in the
				array.

				The structure of a pattern contains the following:
				uint8 start_position
					The index in an AD data field where the search
					should start. The beginning of an AD data field
					is index 0.
				uint8 AD_data_type
					See https://www.bluetooth.com/specifications/
					assigned-numbers/generic-access-profile/ for
					the possible allowed value.
	*/
	Patterns []Pattern

	/*
		RSSIHighThreshold Used in conjunction with RSSIHighTimeout to determine
				whether a device becomes in-range. Valid range is
				-127 to 20 (dBm), while 127 indicates unset.
	*/
	RSSIHighThreshold int16

	/*
		RSSIHighTimeout The time it takes to consider a device as in-range.
				If this many seconds elapses while we continuously
				receive signals at least as strong as RSSIHighThreshold,
				a currently out-of-range device will be considered as
				in-range (found). Valid range is 1 to 300 (seconds),
				while 0 indicates unset.
	*/
	RSSIHighTimeout uint16

	/*
		RSSILowThreshold Used in conjunction with RSSILowTimeout to determine
				whether a device becomes out-of-range. Valid range is
				-127 to 20 (dBm), while 127 indicates unset.
	*/
	RSSILowThreshold int16

	/*
		RSSILowTimeout The time it takes to consider a device as out-of-range.
				If this many seconds elapses without receiving any
				signal at least as strong as RSSILowThreshold, a
				currently in-range device will be considered as
				out-of-range (lost). Valid range is 1 to 300 (seconds),
				while 0 indicates unset.
	*/
	RSSILowTimeout uint16

	/*
		RSSISamplingPeriod Grouping rules on how to propagate the received
				advertisement packets to the client. Valid range is 0 to
				255 while 256 indicates unset.

				The meaning of this property is as follows:
				0:
					All advertisement packets from in-range devices
					would be propagated.
				255:
					Only the first advertisement packet of in-range
					devices would be propagated. If the device
					becomes lost, then the first packet when it is
					found again will also be propagated.
				1 to 254:
					Advertisement packets would be grouped into
					100ms * N time period. Packets in the same group
					will only be reported once, with the RSSI value
					being averaged out.

				Currently this is unimplemented in user space, so the
				value is only used to be forwarded to the kernel.
	*/
	RSSISamplingPeriod uint16

	/*
		Type The type of the monitor. See SupportedMonitorTypes in
				org.bluez.AdvertisementMonitorManager1 for the available
				options.
	*/
	Type string
	// contains filtered or unexported fields
}

AdvertisementMonitor1Properties contains the exposed properties of an interface

func (*AdvertisementMonitor1Properties) FromDBusMap

func (a *AdvertisementMonitor1Properties) FromDBusMap(props map[string]dbus.Variant) (*AdvertisementMonitor1Properties, error)

FromDBusMap convert a map to an AdvertisementMonitor1Properties

func (*AdvertisementMonitor1Properties) FromMap

func (a *AdvertisementMonitor1Properties) FromMap(props map[string]interface{}) (*AdvertisementMonitor1Properties, error)

FromMap convert a map to an AdvertisementMonitor1Properties

func (*AdvertisementMonitor1Properties) Lock

Lock access to properties

func (*AdvertisementMonitor1Properties) ToMap

func (a *AdvertisementMonitor1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a AdvertisementMonitor1Properties to map

func (*AdvertisementMonitor1Properties) Unlock

func (p *AdvertisementMonitor1Properties) Unlock()

Unlock access to properties

type AdvertisementMonitorManager1

type AdvertisementMonitorManager1 struct {
	Properties *AdvertisementMonitorManager1Properties
	// contains filtered or unexported fields
}

AdvertisementMonitorManager1 Advertisement Monitor Manager hierarchy

func NewAdvertisementMonitorManager1

func NewAdvertisementMonitorManager1(objectPath dbus.ObjectPath) (*AdvertisementMonitorManager1, error)

NewAdvertisementMonitorManager1 create a new instance of AdvertisementMonitorManager1

Args: - objectPath: /org/bluez/{hci0,hci1,...}

func (*AdvertisementMonitorManager1) Client

Client return AdvertisementMonitorManager1 dbus client

func (*AdvertisementMonitorManager1) Close

func (a *AdvertisementMonitorManager1) Close()

Close the connection

func (*AdvertisementMonitorManager1) GetObjectManagerSignal

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

GetObjectManagerSignal return a channel for receiving updates from the ObjectManager

func (*AdvertisementMonitorManager1) GetProperties

GetProperties load all available properties

func (*AdvertisementMonitorManager1) GetPropertiesSignal

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

GetPropertiesSignal return a channel for receiving udpdates on property changes

func (*AdvertisementMonitorManager1) GetProperty

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

GetProperty get a property

func (*AdvertisementMonitorManager1) GetSupportedFeatures

func (a *AdvertisementMonitorManager1) GetSupportedFeatures() ([]string, error)

GetSupportedFeatures get SupportedFeatures value

func (*AdvertisementMonitorManager1) GetSupportedMonitorTypes

func (a *AdvertisementMonitorManager1) GetSupportedMonitorTypes() ([]string, error)

GetSupportedMonitorTypes get SupportedMonitorTypes value

func (*AdvertisementMonitorManager1) GetWatchPropertiesChannel

func (a *AdvertisementMonitorManager1) GetWatchPropertiesChannel() chan *dbus.Signal

GetWatchPropertiesChannel return the dbus channel to receive properties interface

func (*AdvertisementMonitorManager1) Interface

func (a *AdvertisementMonitorManager1) Interface() string

Interface return AdvertisementMonitorManager1 interface

func (*AdvertisementMonitorManager1) Path

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

Path return AdvertisementMonitorManager1 object path

func (*AdvertisementMonitorManager1) RegisterMonitor

func (a *AdvertisementMonitorManager1) RegisterMonitor(application dbus.ObjectPath) error

RegisterMonitor This registers the root path of a hierarchy of

advertisement monitors.
The application object path together with the D-Bus
system bus connection ID define the identification of
the application registering advertisement monitors.
Once a root path is registered by a client via this
method, the client can freely expose/unexpose
advertisement monitors without re-registering the root
path again. After use, the client should call
UnregisterMonitor() method to invalidate the
advertisement monitors.
Possible errors: org.bluez.Error.InvalidArguments
		 org.bluez.Error.AlreadyExists
		 org.bluez.Error.Failed

func (*AdvertisementMonitorManager1) SetProperty

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

SetProperty set a property

func (*AdvertisementMonitorManager1) SetWatchPropertiesChannel

func (a *AdvertisementMonitorManager1) SetWatchPropertiesChannel(c chan *dbus.Signal)

SetWatchPropertiesChannel set the dbus channel to receive properties interface

func (*AdvertisementMonitorManager1) ToProps

ToProps return the properties interface

func (*AdvertisementMonitorManager1) UnregisterMonitor

func (a *AdvertisementMonitorManager1) UnregisterMonitor(application dbus.ObjectPath) error

UnregisterMonitor This unregisters a hierarchy of advertisement monitors

that has been previously registered. The object path
parameter must match the same value that has been used
on registration. Upon unregistration, the advertisement
monitor(s) should expect to receive Release() method as
the signal that the advertisement monitor(s) has been
deactivated.
Possible errors: org.bluez.Error.InvalidArguments
		 org.bluez.Error.DoesNotExist

func (*AdvertisementMonitorManager1) UnwatchProperties

func (a *AdvertisementMonitorManager1) UnwatchProperties(ch chan *bluez.PropertyChanged) error

func (*AdvertisementMonitorManager1) WatchProperties

func (a *AdvertisementMonitorManager1) WatchProperties() (chan *bluez.PropertyChanged, error)

WatchProperties updates on property changes

type AdvertisementMonitorManager1Properties

type AdvertisementMonitorManager1Properties struct {

	/*
		SupportedFeatures This lists the features of advertisement monitoring
				supported by BlueZ.

				Possible values for features:

				"controller-patterns"
					If the controller is capable of performing
					advertisement monitoring by patterns, BlueZ
					would offload the patterns to the controller to
					reduce power consumption.
	*/
	SupportedFeatures []string

	/*
		SupportedMonitorTypes This lists the supported types of advertisement
				monitors. An application should check this before
				instantiate and expose an object of
				org.bluez.AdvertisementMonitor1.

				Possible values for monitor types:

				"or_patterns"
					Patterns with logic OR applied. With this type,
					property "Patterns" must exist and has at least
					one pattern.
	*/
	SupportedMonitorTypes []string
	// contains filtered or unexported fields
}

AdvertisementMonitorManager1Properties contains the exposed properties of an interface

func (*AdvertisementMonitorManager1Properties) FromDBusMap

FromDBusMap convert a map to an AdvertisementMonitorManager1Properties

func (*AdvertisementMonitorManager1Properties) FromMap

FromMap convert a map to an AdvertisementMonitorManager1Properties

func (*AdvertisementMonitorManager1Properties) Lock

Lock access to properties

func (*AdvertisementMonitorManager1Properties) ToMap

func (a *AdvertisementMonitorManager1Properties) ToMap() (map[string]interface{}, error)

ToMap convert a AdvertisementMonitorManager1Properties to map

func (*AdvertisementMonitorManager1Properties) Unlock

Unlock access to properties

type Pattern

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

array{(uint8, uint8, array{byte})}

type Patterns

type Patterns = []Pattern

Jump to

Keyboard shortcuts

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