Crate cec_linux

Source
Expand description

Use CEC linux API in pure rust.

Create a CecDevice and optionally change its mode to send and receive messages to and from other devices.

let cec = CecDevice::open("/dev/cec0")?;
cec.set_mode(CecModeInitiator::Send, CecModeFollower::All)?;
cec.transmit(
     CecLogicalAddress::Playback2,
     CecLogicalAddress::Audiosystem,
     CecOpcode::Standby,
 )?;
let msg = cec.rec()?;

Modules§

tokiotokio

Structs§

Capabilities
capabilities of the CEC adapter
CecCaps
information about the CEC adapter
CecDevice
A handle on a CEC device.
CecEventLostMsgs
CecEvent that tells you how many messages were lost
CecEventStateChange
CecEvent used when the CEC adapter changes state.
CecLogAddrFlags
Flags for CecLogAddrs
CecLogAddrMask
The bitmask of all logical addresses this adapter has claimed.
CecLogAddrs
CEC logical addresses structure used by CecDevice::set_log and CecDevice::get_log
CecMsg
CEC message returned from CecDevice::rec and CecDevice::rec_for
CecPhysicalAddress
CEC physical address
CecTimer
Payload of CecOpcode::SetAnalogueTimer, CecOpcode::SetDigitalTimer or CecOpcode::SetExtTimer
OSDStr
Payload of CecOpcode::SetOsdString and CecOpcode::SetOsdName
PollFlagspoll
These flags define the different events that can be monitored by poll and ppoll
PollTimeoutpoll
PollTimeout argument for polling.
RecordingSequence
Payload of CecOpcode::SetAnalogueTimer, CecOpcode::SetDigitalTimer or CecOpcode::SetExtTimer
VendorID

Enums§

CecAbortReason
used by CecOpcode::FeatureAbort
CecEvent
Event returned by CecDevice::get_event
CecLogAddrType
The logical address types that the CEC device wants to claim
CecLogicalAddress
The logical addresses defined by CEC 2.0
CecModeFollower
Modes for follower
CecModeInitiator
Modes for initiator
CecOpcode
The opcode of a CecMsg
CecPowerStatus
Payload of CecOpcode::ReportPowerStatus
CecPrimDevType
Primary Device Type Operand (prim_devtype)
CecUserControlCode
parameter for CecOpcode::UserControlPressed
DeckControlMode
used by CecOpcode::DeckControl
DeckInfo
used by CecOpcode::DeckStatus
DisplayControl
used by CecOpcode::SetOsdString
MenuRequestType
used by CecOpcode::MenuRequest
PlayMode
used by CecOpcode::Play
StatusRequest
used by CecOpcode::GiveDeckStatus and CecOpcode::GiveTunerDeviceStatus
Version
CEC Version Operand for CecOpcode::CecVersion