barista.run: barista.run/modules/bluetooth Index | Files

package bluetooth

import "barista.run/modules/bluetooth"

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

Package Files

adapter.go device.go

type AdapterInfo Uses

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 Uses

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

AdapterModule represents a Bluetooth bar module.

func Adapter Uses

func Adapter(name string) *AdapterModule

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

func DefaultAdapter Uses

func DefaultAdapter() *AdapterModule

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

func (*AdapterModule) Output Uses

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 Uses

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

Stream starts the module.

type DeviceInfo Uses

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 Uses

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

DeviceModule represents a Bluetooth devices bar module.

func Device Uses

func Device(adapter, mac string) *DeviceModule

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

func (*DeviceModule) Output Uses

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 Uses

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

Stream starts the module.

Package bluetooth imports 5 packages (graph). Updated 2019-11-12. Refresh now. Tools for package owners.