Help us shape the future of Go! Take the 2026 Go Developer Survey

ble

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ble provides a channel.Notifier that sends short status messages to a JCODE-* BLE IoT device using the Nordic UART Service (NUS).

The notifier auto-discovers nearby JCODE-* devices on first use and reconnects on failure. All sends are best-effort and non-blocking.

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 implements channel.Notifier for BLE IoT devices.

func New

func New() *Notifier

New creates a BLE notifier. It does NOT block — device discovery happens lazily on the first Notify call (in a background goroutine).

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)

Notify sends a command to the BLE device based on the event type. If the device is not connected yet, a background connection is triggered.

func (*Notifier) Receive added in v0.3.4

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

Receive returns a channel that delivers commands received from the BLE device.

type ReceivedCommand added in v0.3.4

type ReceivedCommand struct {
	Cmd string // "input", "submit", "cancel"
	Val string // payload for "input" command
}

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