Documentation
¶
Overview ¶
Package screenwire defines EPS2 bounded screen records, not authentication. Network records must pass the authenticated encryption layer before decoding. EPS1 remains a separate historical package and is never auto-detected here.
Index ¶
- Constants
- Variables
- func DecodeRefreshBegin(b []byte) ([32]byte, refreshpolicy.Options, refreshpolicy.Policy, error)
- func Encode(dst []byte, r Record) (int, error)
- func EncodeCapabilities(dst []byte, c Capabilities) error
- func EncodeHealth(dst []byte, h HealthStatus) error
- func EncodePanelStatus(dst []byte, p PanelStatus) error
- func EncodeRefreshBegin(digest [32]byte, options refreshpolicy.Options, policy refreshpolicy.Policy) ([44]byte, error)
- func EncodeRegionBegin(r RegionBegin) ([RegionBeginSize]byte, error)
- func EncodeStatus(dst []byte, s Status) error
- func Size(header []byte) (int, error)
- type BusySamples
- type Capabilities
- type Code
- type Diagnostic
- type Domain
- type HealthStatus
- type Kind
- type PanelStatus
- type Record
- type RegionBegin
- type Response
- type Status
Constants ¶
const ( HeaderSize = 32 MaxPayload = 1024 MaxRecord = HeaderSize + MaxPayload StatusSize = 48 CapabilitiesSize = 40 )
const FeaturePackBits uint16 = 1 << 2 // Optional bounded PackBits DataPacked.
const FeatureRefreshPolicy uint16 = 1 << 3 // BeginRefresh with explicit cadence.
const FeatureRegion uint16 = 1 << 4 // BeginRegion with old/new pixel passes.
const HealthSize = 8
const HealthVersion uint8 = 1
const Mono1 uint8 = 1
const PanelStatusSize = 36
const RawFull uint16 = 3 // bit 0 raw mono1 encoding; bit 1 full refresh
const RegionBeginSize = 148
Variables ¶
var ErrRecord = errors.New("screen wire: invalid EPS2 record")
Functions ¶
func DecodeRefreshBegin ¶
func DecodeRefreshBegin(b []byte) ([32]byte, refreshpolicy.Options, refreshpolicy.Policy, error)
func EncodeCapabilities ¶
func EncodeCapabilities(dst []byte, c Capabilities) error
func EncodeHealth ¶
func EncodeHealth(dst []byte, h HealthStatus) error
func EncodePanelStatus ¶
func EncodePanelStatus(dst []byte, p PanelStatus) error
func EncodeRefreshBegin ¶
func EncodeRefreshBegin(digest [32]byte, options refreshpolicy.Options, policy refreshpolicy.Policy) ([44]byte, error)
BeginRefresh extends Begin; Commit and Query keep the original digest identity. The receiver rejects consumed IDs regardless of options. Cadence is selected before staging and cannot be changed by replaying Begin or Commit.
func EncodeRegionBegin ¶
func EncodeRegionBegin(r RegionBegin) ([RegionBeginSize]byte, error)
func EncodeStatus ¶
Types ¶
type BusySamples ¶
type BusySamples struct{ Samples, LowSamples uint32 }
BusySamples counts actual reads, not edges or independently measured voltage.
type Capabilities ¶
type Capabilities struct {
Width, Height, Stride, MaxChunk uint16
Passes, Format uint8
Features uint16
Profile uint32
ProfileVersion uint16
MinimumFullMS uint32
DeviceID [16]byte
}
Capabilities are physical adapter properties, not remotely editable settings. New dimensions are valid only with a matching local panel implementation.
func DecodeCapabilities ¶
func DecodeCapabilities(src []byte) (Capabilities, error)
type Diagnostic ¶
type Diagnostic struct {
Domain Domain
Code, Phase, Step, Command uint8
Offset int32
BusyKnown, Busy bool
}
Diagnostic carries only bounded numeric hardware evidence, never err.Error(). Panel-specific phase/step/code values belong to the negotiated profile.
type HealthStatus ¶
HealthStatus is a source-free network snapshot, not a panel diagnostic. State and LastFailure use the frozen 0..7 values documented in docs/eps2-wire.md. Failures counts unexpected failed attempts in this boot, saturating at 255.
func DecodeHealth ¶
func DecodeHealth(src []byte) (HealthStatus, error)
type Kind ¶
type Kind uint8
const ( Hello Kind = iota + 1 Acquire Bind Begin Data Commit Query Abort Reply Health // Additive request; Reply's existing wire value remains 9. DataPacked // Negotiated PackBits; coordinates and progress are decoded bytes. PanelTrace // Cached physical-cycle observation; no ownership or pixel proof. BeginRefresh // Negotiated per-transaction operator cadence, never a BUSY override. BeginRegion // Old/new region contract; dispatch requires a capable physical adapter. )
type PanelStatus ¶
type PanelStatus struct {
Version, State, Phase, Step uint8
Cycle, ElapsedMS uint32
Waits [3]BusySamples
}
PanelStatus is a boot-local, cached last-cycle trace, never pixel proof. State: unavailable=0, active=1, completed=2, stopped/error=3. Phase/Step belong to the negotiated panel profile. Waits are power-on, refresh, power-off.
func DecodePanelStatus ¶
func DecodePanelStatus(src []byte) (PanelStatus, error)
type RegionBegin ¶
type RegionBegin struct {
Baseline, Old, New [32]byte
Left, Top, Right, Bottom uint16
Priority refreshpolicy.Priority
Policy refreshpolicy.Policy
}
RegionBegin binds an old/new pixel pair to a confirmed transaction identity. Coordinates are half-open. Panel-specific minimum sizes remain adapter rules. See docs/eps2-region.md; this codec does not grant partial-refresh capability.
func DecodeRegionBegin ¶
func DecodeRegionBegin(b []byte, width, height uint16) (RegionBegin, error)
type Response ¶
type Response struct {
Status Status
Capabilities Capabilities // populated only for Hello
Health HealthStatus // populated only for Health
Panel PanelStatus // populated only for PanelTrace
}
func ParseReply ¶
ParseReply is mandatory after generic Decode on the client. It correlates the reply with the exact request, including operation-specific body length. The client must additionally bind boot/generation to its remembered lease.