bluetooth

package
v0.0.0-...-c936f35 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package bluetooth provides modules for watching the status of Bluetooth adapters and devices.

Package bluetooth provides modules for watching the status of Bluetooth adapters and devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterInfo

type AdapterInfo struct {
	Name         string
	Alias        string
	Address      string
	Discoverable bool
	Pairable     bool
	Powered      bool
	Discovering  bool
}

AdapterInfo represents a Bluetooth adapters information.

type AdapterModule

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

AdapterModule represents a Bluetooth bar module.

func Adapter

func Adapter(name string) *AdapterModule

Adapter constructs an instance of the bluetooth module with the provided device name (ex. "hci1").

func DefaultAdapter

func DefaultAdapter() *AdapterModule

DefaultAdapter constructs an instance of the bluetooth module using the first adapter ("hci0").

func (*AdapterModule) Output

func (bt *AdapterModule) Output(outputFunc func(AdapterInfo) bar.Output) *AdapterModule

Output configures a module to display the output of a user-defined function.

func (*AdapterModule) Stream

func (bt *AdapterModule) Stream(sink bar.Sink)

Stream starts the module.

type DeviceInfo

type DeviceInfo struct {
	Name      string
	Alias     string
	Address   string
	Adapter   string
	Battery   int
	Paired    bool
	Connected bool
	Trusted   bool
	Blocked   bool
}

DeviceInfo represents Bluetooth device information.

type DeviceModule

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

DeviceModule represents a Bluetooth devices bar module.

func Device

func Device(adapter, mac string) *DeviceModule

Device constructs a bluetooth device module instance for the given adapter and MAC address.

func (*DeviceModule) Output

func (m *DeviceModule) Output(outputFunc func(DeviceInfo) bar.Output) *DeviceModule

Output configures a module to display the output of a user-defined function.

func (*DeviceModule) Stream

func (m *DeviceModule) Stream(sink bar.Sink)

Stream starts the module.

Jump to

Keyboard shortcuts

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