workerclient

package
v0.1.0-alpha.85 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: GPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package workerclient starts the shared native Bluetooth worker process and adapts it to ble.Connector and ble.Link. The worker owns the radio; this side owns its lifetime, so a hung or crashed worker never outlives the link.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector starts one worker process per connection.

func NewConnector

func NewConnector(options Options) *Connector

NewConnector returns a worker-backed connector.

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context, request ble.ConnectRequest) (ble.Link, error)

Connect starts the worker, checks its protocol version and asks it to find and connect the Bluetooth device. Any failure stops the worker again.

func (*Connector) Discover

func (c *Connector) Discover(ctx context.Context, duration time.Duration) ([]ble.Candidate, error)

Discover owns a short-lived scan worker, independent of any connected device.

func (*Connector) Simulated

func (c *Connector) Simulated() bool

Simulated reports that links reach a real radio.

type Options

type Options struct {
	// Path is the worker executable. An empty path means the helper is
	// missing from this installation.
	Profile string
	Path    string
	Args    []string
	Logger  *slog.Logger
}

Options locates the worker executable.

Jump to

Keyboard shortcuts

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