display

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 10 Imported by: 0 modules, 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 display reads and sets the EDID the JetKVM presents to the target over HDMI, which decides the video modes the target offers.

Index

Constants

View Source
const DefaultPreset = "JetKVM Default"

DefaultPreset is the name of the firmware's own EDID preset.

Variables

View Source
var ErrBadEDID = errors.New("not a preset name or EDID hex")

ErrBadEDID means the argument is neither a preset name nor an EDID.

Functions

func EDID

func EDID(ctx context.Context, d kvm.RPC) (string, error)

EDID returns the EDID in use, as hex.

func PreferredMode

func PreferredMode(edid string) (width, height int)

PreferredMode reads the active size from an EDID's first detailed timing descriptor (bytes 54..71). It returns zeros when there is none.

func Resolve

func Resolve(ps []Preset, arg string) (string, error)

Resolve turns a preset name (case-insensitive) or EDID hex into hex.

Types

type Preset

type Preset struct {
	Name string `json:"name"`
	// Width and Height are the preferred mode from the EDID's first detailed
	// timing; zero when it has none.
	Width  int    `json:"width"`
	Height int    `json:"height"`
	EDID   string `json:"edid"`
}

Preset is one of the device's built-in EDIDs (getEDIDPresets).

func Presets

func Presets(ctx context.Context, d kvm.RPC) ([]Preset, error)

Presets returns the device's EDID presets.

type SetOptions

type SetOptions struct {
	// Settle is how long to wait after setEDID before polling, so the
	// target has time to drop the old mode. Default 1s.
	Settle time.Duration
	// Interval is the poll interval for getVideoState. Default 500ms.
	Interval time.Duration
}

SetOptions control Set.

type Status

type Status struct {
	Video
	// Preset names the preset whose EDID is in use, "" for a custom one.
	Preset string `json:"preset"`
	EDID   string `json:"edid"`
}

Status is the video state and the EDID in use.

func GetStatus

func GetStatus(ctx context.Context, d kvm.RPC) (Status, error)

GetStatus returns the video state, the EDID in use and its preset name.

type Video

type Video struct {
	Ready  bool    `json:"ready"`
	Width  int     `json:"width"`
	Height int     `json:"height"`
	FPS    float64 `json:"fps"`
}

Video is the captured HDMI input (getVideoState).

func Set

func Set(ctx context.Context, d kvm.RPC, edid string, opt SetOptions) (Video, error)

Set sets the EDID and waits until the device reports video ready again, then returns the new video state. The caller's context bounds the wait.

func VideoState

func VideoState(ctx context.Context, d kvm.RPC) (Video, error)

VideoState returns getVideoState.

Jump to

Keyboard shortcuts

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