devicelink

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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