ble

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

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

Notifier relays notification events to the jcode-ble helper process.

func New

func New() *Notifier

New spawns the jcode-ble helper (if present) and returns a notifier. It is only constructed when BLE is enabled in config, so the helper — and any Bluetooth prompt — only appears then.

func (*Notifier) Available

func (n *Notifier) Available() bool

func (*Notifier) Close

func (n *Notifier) Close()

func (*Notifier) Name

func (n *Notifier) Name() string

func (*Notifier) Notify

func (n *Notifier) Notify(event channel.NotifyEvent)

func (*Notifier) Receive added in v0.3.4

func (n *Notifier) Receive() <-chan ReceivedCommand

type Proxy added in v0.8.1

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

Proxy is a channel.Notifier that forwards to a live BLE notifier which can be swapped in/out at runtime. It is added once to each task's notifier chain, so enabling/disabling BLE takes effect immediately across all active tasks without an app restart. When no inner notifier is set, it is a no-op.

Notifier's concrete type differs per build (real BLE vs. helper-spawner), but both expose the same New()/*Notifier surface, so this file is build-tag free.

func (*Proxy) Active added in v0.8.1

func (p *Proxy) Active() bool

Active reports whether BLE is currently live.

func (*Proxy) Available added in v0.8.1

func (p *Proxy) Available() bool

Available reports whether a live notifier is present and ready.

func (*Proxy) Close added in v0.8.1

func (p *Proxy) Close()

Close tears down the inner notifier.

func (*Proxy) Disable added in v0.8.1

func (p *Proxy) Disable()

Disable stops and forgets the inner notifier.

func (*Proxy) Enable added in v0.8.1

func (p *Proxy) Enable()

Enable spawns a fresh BLE notifier (the helper) if not already running and pushes an initial idle event so the device connects (and macOS prompts, if it is going to) right away.

func (*Proxy) Name added in v0.8.1

func (p *Proxy) Name() string

Name implements channel.Notifier.

func (*Proxy) Notify added in v0.8.1

func (p *Proxy) Notify(event channel.NotifyEvent)

Notify forwards to the current inner notifier (no-op when disabled).

type ReceivedCommand added in v0.3.4

type ReceivedCommand struct {
	Cmd string `json:"cmd"`
	Val string `json:"val"`
}

ReceivedCommand is a parsed command received from the BLE device.

Jump to

Keyboard shortcuts

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