Versions in this module Expand all Collapse all v0 v0.0.22 Apr 29, 2026 v0.0.21 Apr 13, 2026 Changes in this version + func OpenSerial(path string, baudRate int) (io.ReadWriteCloser, error) + func WatchBLE(serviceUUIDs []string, cb func(devices []BLEDevice)) (stop func()) + func WatchSerial(cb func(ports []SerialPort)) (stop func()) + type BLEConnection interface + Disconnected func() <-chan struct{} + ReadCharacteristic func(uuid string) ([]byte, error) + Subscribe func(uuid string) (<-chan []byte, error) + Unsubscribe func(uuid string) error + WriteCharacteristic func(uuid string, data []byte) error + func ConnectBLE(address string) (BLEConnection, error) + type BLEDevice struct + Address string + Name string + RSSI int + ServiceUUIDs []string + type CameraDevice struct + Facing string + ID string + Name string + type GATTService struct + CharacteristicUUIDs []string + UUID string + type Platform struct + BLEConnect func(address string) (handle int64, err error) + BLEDisconnect func(handle int64) error + BLEOnDisconnect func(handle int64, cb func()) + BLERead func(handle int64, charUUID string) ([]byte, error) + BLEServices func(handle int64) ([]GATTService, error) + BLESubscribe func(handle int64, charUUID string, cb func(data []byte)) error + BLEUnsubscribe func(handle int64, charUUID string) error + BLEWatch func(serviceUUIDs []string, cb func(devices []BLEDevice)) (stop func()) + BLEWrite func(handle int64, charUUID string, data []byte) error + ReadSensors func() []SensorReading + SerialClose func(handle int64) error + SerialOpen func(path string, baudRate int) (handle int64, err error) + SerialRead func(handle int64, maxLen int) ([]byte, error) + SerialWatch func(cb func(ports []SerialPort)) (stop func()) + SerialWrite func(handle int64, data []byte) (int, error) + var P Platform + type SensorReading struct + ID uint32 + Kind int32 + Label string + Unit int32 + Value float64 + func ReadSensors() []SensorReading + type SerialPort struct + Key string + ManufacturerName string + Name string + Path string + ProductID uint32 + ProductName string + SerialNumber string + StablePath string + VendorID uint32 + type StreamAdapter struct + func NewStreamAdapter(conn BLEConnection, writeUUID, readUUID string) (*StreamAdapter, error) + func (s *StreamAdapter) Close() error + func (s *StreamAdapter) Read(p []byte) (int, error) + func (s *StreamAdapter) Write(p []byte) (int, error)