devicelink

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package devicelink transports update records over authenticated encryption.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfiguration = errors.New("device link: invalid configuration")
	ErrProtocol      = errors.New("device link: invalid protocol")
)

Functions

func Exchange

func Exchange(connection io.ReadWriter, config DeviceConfig, random io.Reader, runtime Runtime) error

Exchange runs one authenticated manager poll. The retained report is sent first, so a terminal physical-refresh result is not lost between polls.

func ServeManager

func ServeManager(connection io.ReadWriter, config ManagerConfig) error

Types

type DeviceConfig

type DeviceConfig struct {
	ID  securetransport.DeviceID
	Key securetransport.Key
}

type DeviceSession

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

func ConnectDevice

func ConnectDevice(connection io.ReadWriter, config DeviceConfig, random io.Reader) (*DeviceSession, error)

func (*DeviceSession) Generation

func (s *DeviceSession) Generation() uint64

func (*DeviceSession) Receive

func (s *DeviceSession) Receive() (update.Request, bool, error)

func (*DeviceSession) Report

func (s *DeviceSession) Report(result *update.Result, generation uint64) error

Report sends retained state from a previous exchange before the manager decides whether a request needs delivery. A nil result means a clean boot with no retained request state.

func (*DeviceSession) SendResult

func (s *DeviceSession) SendResult(result update.Result) error

type ManagerConfig

type ManagerConfig struct {
	Registry manager.Registry
	Store    *manager.Store
	Random   io.Reader
	Now      manager.Clock
}

type Runtime

type Runtime interface {
	ApplyNetwork(update.Request) update.Result
	RecordNetwork(uint64, update.Result)
	NetworkReport() (update.Result, uint64, bool)
}

Jump to

Keyboard shortcuts

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