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) 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) Available ¶ added in v0.8.1
Available reports whether a live notifier is present and ready.
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) 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
ReceivedCommand is a parsed command received from the BLE device.