scanner

package
v0.0.0-...-09b1dbd Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, h Handler) error

Run scans bluetooth devices for the Victron advertisement data, and calls the callback each time it sees one. Stops when the context is canceled.

Types

type Advertisement struct {
	Addr  string
	Mode  byte
	Model uint16
	// contains filtered or unexported fields
}

func (Advertisement) Decrypt

func (a Advertisement) Decrypt(key []byte) ([]byte, error)

Decrypt decrypts the advert payload using the key.

type Handler

type Handler interface {
	Handle(advert Advertisement)
}

Handler handlers BLE advertisements.

func FanoutHandler

func FanoutHandler(handlers ...Handler) Handler

FanoutHandler sends adverts to every provided handler.

type HandlerFunc

type HandlerFunc func(advert Advertisement)

func (HandlerFunc) Handle

func (f HandlerFunc) Handle(advert Advertisement)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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