Documentation
¶
Overview ¶
Package bluetooth owns the lifecycle of the local Bluetooth adapter for the app-facing BLE transport: when to open it, when to give up, and when to try again after a dongle is plugged in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager keeps an adapter open while the BLE transport is enabled and hands its peripheral side to whoever registered interest.
func NewManager ¶
NewManager builds a manager over the system's Bluetooth stack. It never powers the adapter on: the radio may be off on purpose, and switching it on would disturb the device's gamepads.
func (*Manager) OnPeripheral ¶
func (m *Manager) OnPeripheral(fn PeripheralFunc) func()
OnPeripheral registers fn to receive the peripheral now, if one is ready, and again after every re-open. The returned function unregisters it.
func (*Manager) SetAdvertisingPaused ¶
SetAdvertisingPaused stops or resumes advertising on the current peripheral and any later one, without dropping connected clients. Core pauses it while the user scans for or pairs a controller, so the radio is free for that.
type PeripheralFunc ¶
type PeripheralFunc func(ble.Peripheral)
PeripheralFunc is called with a ready peripheral each time one becomes available. It must not block: start any long-running work on a goroutine.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apigatt defines the GATT contract the Zaparoo app uses to reach the JSON-RPC API over Bluetooth Low Energy: the service and characteristic UUIDs, the limits, and the framing that carries one API message across many small ATT packets.
|
Package apigatt defines the GATT contract the Zaparoo app uses to reach the JSON-RPC API over Bluetooth Low Energy: the service and characteristic UUIDs, the limits, and the framing that carries one API message across many small ATT packets. |
|
Zaparoo Core Copyright (c) 2026 The Zaparoo Project Contributors.
|
Zaparoo Core Copyright (c) 2026 The Zaparoo Project Contributors. |