Documentation
¶
Overview ¶
Package bt provides cross-platform Bluetooth Classic discovery, pairing and SPP connection for PITEC chambers. Each platform has its own backend:
- macOS: shells out to blueutil (brew install blueutil)
- Linux: BlueZ over D-Bus for scan/pair, raw RFCOMM socket for data
- Windows: Win32 Bluetooth API for scan/pair, registry lookup for the virtual COM port created after pairing
The per-platform files implement:
Scan(ctx) ([]Device, error) — discover nearby + known devices Pair(ctx, dev, pin) error — pair with a fixed PIN Connect(dev) (device.Transport, error) — open the SPP data channel
Index ¶
Constants ¶
View Source
const DefaultPIN = "1010"
DefaultPIN is the pairing key used by PITEC Bluetooth modules.
Variables ¶
This section is empty.
Functions ¶
func NormalizeAddr ¶
NormalizeAddr converts a MAC address to canonical "AA:BB:CC:DD:EE:FF" form.
Types ¶
type Device ¶
Device is a Bluetooth device found during a scan.
func FilterPitecs ¶
FilterPitecs returns only the devices whose name matches IsPitec.
Click to show internal directories.
Click to hide internal directories.