Documentation
¶
Overview ¶
Package screenclient sends prepared pixels using EPS2 over USB or an already authenticated encrypted stream. Retain one Client across reconnects; never log its private acquisition claim. It has no automatic physical-update retry.
Index ¶
- Variables
- func ReadHealth(stream io.ReadWriter) (screenwire.Response, error)
- func ReadPanelTrace(stream io.ReadWriter) (screenwire.Response, error)
- type Client
- func (c *Client) Baseline() [32]byte
- func (c *Client) Connect(stream io.ReadWriter) (screenwire.Capabilities, error)
- func (c *Client) Pending() bool
- func (c *Client) Probe() error
- func (c *Client) Rebind() error
- func (c *Client) Reconcile() (Reconciliation, error)
- func (c *Client) Send(frame display.Frame) error
- func (c *Client) SendRegion(region screenwire.RegionBegin, old, next []byte) error
- func (c *Client) SendWithOptions(frame display.Frame, options refreshpolicy.Options, ...) error
- type Reconciliation
- type RemoteError
Constants ¶
This section is empty.
Variables ¶
var ( ErrResync = errors.New("screen client: boot or ownership changed; full resynchronization required") ErrPending = errors.New("screen client: reconcile pending update before sending") ErrConnection = errors.New("screen client: connection not bound") )
var ErrUnsupportedRefresh = errors.New("screen client: requested refresh policy unsupported")
Functions ¶
func ReadHealth ¶
func ReadHealth(stream io.ReadWriter) (screenwire.Response, error)
ReadHealth performs exactly one read-only exchange: no Hello, Acquire, Bind, transaction or retry. The caller serializes and bounds the borrowed stream; network input must already be authenticated. It does not alter another Client.
func ReadPanelTrace ¶
func ReadPanelTrace(stream io.ReadWriter) (screenwire.Response, error)
ReadPanelTrace borrows a serialized, bounded, already-trusted stream for one read-only exchange. No retry, lease acquisition, or panel operation occurs.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithMaxChunk ¶
NewWithMaxChunk additionally bounds decoded data bytes per request, independently of the negotiated device capabilities. The limit is fixed across reconnects. Account for screenwire.HeaderSize in the transport RX budget. Packed encoding never enlarges a request; region control requires 180 bytes including headers.
func (*Client) Baseline ¶
Baseline is the last confirmed transaction identity, not necessarily a pixel hash. Zero means unavailable; the caller owns the corresponding pixel snapshot.
func (*Client) Connect ¶
func (c *Client) Connect(stream io.ReadWriter) (screenwire.Capabilities, error)
Connect borrows a deadline-bounded stream. The caller must close the previous transport first. A changed boot/lease is explicit ErrResync; use a fresh Client only after invalidating the manager's unproven pixel baseline.
func (*Client) Probe ¶
Probe checks a remembered connection using read-only Hello. It cannot adopt ownership, reconcile an unknown update, or perform a physical refresh. The single client owner must reconcile pending identity before an idle probe.
func (*Client) Rebind ¶
Rebind renews only a remembered lease on a still-open, idle USB-UART stream. Unlike read-only Probe it sends Bind, but never Acquire, pixels or Refresh. Use after an adapter's logical idle disconnect, with no concurrent I/O. An unknown update must use Connect/Reconcile instead; it is never replayed here.
func (*Client) Reconcile ¶
func (c *Client) Reconcile() (Reconciliation, error)
Reconcile never refreshes. Confirmed proves the pending physical operation; false requires baseline invalidation and a new complete Send at a new ID. Receiving/Ready staging is explicitly aborted before releasing the identity.
func (*Client) Send ¶
Send borrows immutable pixels until return. A failure retains its identity but no pixel slice; Reconcile must resolve it before another Send is allowed.
func (*Client) SendRegion ¶
func (c *Client) SendRegion(region screenwire.RegionBegin, old, next []byte) error
SendRegion borrows immutable canonical old/new region pixels until return. No refresh is retried. An admitted failure must be resolved by Reconcile.
func (*Client) SendWithOptions ¶
func (c *Client) SendWithOptions(frame display.Frame, options refreshpolicy.Options, policy refreshpolicy.Policy) error
SendWithOptions requires explicit peer advertisement. No fallback can turn an urgent or partial request into a different operation without the caller knowing.
type Reconciliation ¶
type Reconciliation struct {
Confirmed bool
Status screenwire.Status
}
type RemoteError ¶
type RemoteError struct{ Status screenwire.Status }
RemoteError carries only typed numeric diagnostics, never device error text.
func (RemoteError) Error ¶
func (e RemoteError) Error() string