freepsbluetooth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bluetooth

type Bluetooth struct {
	GE *freepsgraph.GraphEngine
	// contains filtered or unexported fields
}

Bluetooth is the operator that provides bluetooth functionality and implements the FreepsGenericOperator interface

func (*Bluetooth) GetDefaultConfig

func (bt *Bluetooth) GetDefaultConfig() interface{}

GetDefaultConfig returns a copy of the default config

func (*Bluetooth) GetHook

func (bt *Bluetooth) GetHook() interface{}

GetHook returns the hook for this operator

func (*Bluetooth) GetPresentDevices

func (bt *Bluetooth) GetPresentDevices(ctx *base.Context, input *base.OperatorIO, gpd GetPresentDevicesParams) *base.OperatorIO

GetPresentDevices is the function that returns the present devices

func (*Bluetooth) InitCopyOfOperator

func (bt *Bluetooth) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)

InitCopyOfOperator creates a copy of the operator and initializes it with the given config

func (*Bluetooth) RestartDiscovery

func (bt *Bluetooth) RestartDiscovery(ctx *base.Context) *base.OperatorIO

RestartDiscovery triggers the Discovery process immediately

func (*Bluetooth) Shutdown

func (bt *Bluetooth) Shutdown(ctx *base.Context)

Shutdown shuts down the operator

func (*Bluetooth) StartListening

func (bt *Bluetooth) StartListening(ctx *base.Context)

StartListening starts the operator

type BluetoothConfig

type BluetoothConfig struct {
	Enabled                bool
	AdapterName            string
	DiscoveryDuration      time.Duration
	DiscoveryPauseDuration time.Duration
	ForgetDeviceDuration   time.Duration
	KnownNamespace         string
	DiscoveredNamespace    string
	MonitorsNamespace      string
}

type DiscoveryData

type DiscoveryData struct {
	Alias            string
	Address          string
	Name             string
	RSSI             int16
	ServiceData      map[string]interface{}
	ManufacturerData map[uint16]interface{}
}

DiscoveryData is the reduced set of information of Device properties send as input to graphs

func (*DiscoveryData) AddManufacturerData added in v1.4.0

func (d *DiscoveryData) AddManufacturerData(companyId uint16, dbv dbus.Variant) error

AddManufacturerData converts the value for a given service to the proper type and adds it to the map under the identifier for the company

func (*DiscoveryData) AddServiceData

func (d *DiscoveryData) AddServiceData(service string, v interface{}) (string, error)

AddServiceData converts the value for a given service to the proper type and adds it to the map under the human readable name if available

func (*DiscoveryData) Update

func (d *DiscoveryData) Update(change string, value interface{}) ([]string, error)

Update applies a change to the current state and returns the name of the changed values

type FreepsBluetooth

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

FreepsBluetooth provides options to scan for bt devices and execute operations based on that

func (*FreepsBluetooth) Shutdown

func (fbt *FreepsBluetooth) Shutdown()

Shutdown stops discovery and does not schedule it again

func (*FreepsBluetooth) StartDiscovery

func (fbt *FreepsBluetooth) StartDiscovery() error

StartDiscovery starts the process of discovery new bluetooth devices

func (*FreepsBluetooth) StopDiscovery

func (fbt *FreepsBluetooth) StopDiscovery(restartImmediately bool)

StopDiscovery stops bluetooth discovery and schedules the next discovery process

type GetPresentDevicesParams

type GetPresentDevicesParams struct {
	MaxAge *time.Duration
}

GetPresentDevicesParams are the parameters for the GetPresentDevices Function

type HookBluetooth

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

func (*HookBluetooth) OnGraphChanged

func (h *HookBluetooth) OnGraphChanged(ctx *base.Context, addedGraphName []string, removedGraphName []string) error

OnGraphChanged checks if subscriptions need to be changed

Jump to

Keyboard shortcuts

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