NanoKVMGo.EDID (nano_kvm_go v0.4.0)

Copy Markdown View Source

Decodes an EDID, such as the one NanoKVMGo.Video.edid/1 returns: who made the display it describes, its name and the modes it lists.

{:ok, edid} = NanoKVMGo.Video.edid()
{:ok, %{name: "NanoKVM-Go", modes: [%{width: 3840, height: 2160} | _]}} =
  NanoKVMGo.EDID.decode(edid)

The modes are the detailed timings of the base block and of CTA-861 extension blocks, the preferred mode first.

Summary

Types

A detailed timing.

t()

Functions

Decodes an EDID of one to four blocks with valid checksums.

Whether edid is an EDID: one to four blocks of 128 bytes, the first with the EDID header, each with a valid checksum. NanoKVMGo.Video.set_edid/2 takes such an EDID.

Types

mode()

@type mode() :: %{
  width: pos_integer(),
  height: pos_integer(),
  refresh: float(),
  pixel_clock_khz: pos_integer(),
  interlaced: boolean()
}

A detailed timing.

t()

@type t() :: %{
  manufacturer: String.t(),
  product: non_neg_integer(),
  serial: non_neg_integer(),
  week: non_neg_integer(),
  year: pos_integer(),
  version: String.t(),
  name: String.t() | nil,
  modes: [mode()],
  extensions: non_neg_integer()
}

Functions

decode(edid)

@spec decode(binary()) :: {:ok, t()} | {:error, :invalid_edid}

Decodes an EDID of one to four blocks with valid checksums.

valid?(edid)

@spec valid?(term()) :: boolean()

Whether edid is an EDID: one to four blocks of 128 bytes, the first with the EDID header, each with a valid checksum. NanoKVMGo.Video.set_edid/2 takes such an EDID.