screenlink

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package screenlink joins EPS2 framing to the retained screen-session core. Callers authenticate network input, serialize ALL connections and poll Tick. One Device owns the panel; opening a connection alone never grants ownership.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func (*Connection) Disconnect

func (c *Connection) Disconnect() error

func (*Connection) Push

func (c *Connection) Push(src []byte, now time.Duration, write func([]byte) error) error

Push accepts arbitrary fragmentation. write must consume borrowed ACK bytes before returning and impose a transport deadline; an ACK error disconnects. Framing failure is fatal for this transport: caller must close/reopen it.

func (*Connection) Revoked

func (c *Connection) Revoked() bool

Revoked reports authentication-lifetime invalidation, not pixel ownership. A physical control callback can revoke even while only inspecting storage.

type Device

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

func New

func New(caps screenwire.Capabilities, boot [16]byte, sink streamrx.Sink, idle, total time.Duration, diagnose func(error) screenwire.Diagnostic) (*Device, error)

func (*Device) Open

func (d *Device) Open() *Connection

Open follows transport authentication. USB priority is an explicit owner-loop decision through Preempt, never a consequence of receiving a Hello packet.

func (*Device) Preempt

func (d *Device) Preempt() error

Preempt aborts incomplete staging. Commit is synchronous; the serialized owner cannot enter here until refresh/BUSY/power-off finishes.

func (*Device) Reconfigure

func (d *Device) Reconfigure(id [16]byte) error

Reconfigure revokes every connection, including authenticated but unbound ones. Call before credential mutation (zero ID) and after authoritative Load. The owner must also stop old network workers and discard their queued events; a worker must never open a fresh connection with stale authentication. It retains refresh cadence; storage generations are not screen generations.

func (*Device) SetHealth

func (d *Device) SetHealth(provider func() screenwire.HealthStatus)

SetHealth is configured once before owner/network tasks start. The callback reads bounded cached state only: never radio/stack calls or hardware probes.

func (*Device) SetPanelTrace

func (d *Device) SetPanelTrace(provider func() screenwire.PanelStatus)

SetPanelTrace installs an owner-serialized cached observer before tasks start. The provider must not read pins, advance timers, or perform any panel I/O.

func (*Device) Tick

func (d *Device) Tick(now time.Duration) error

Jump to

Keyboard shortcuts

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