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§
- tokio
tokio
Structs§
- capabilities of the CEC adapter
- information about the CEC adapter
- A handle on a CEC device.
- CecEvent that tells you how many messages were lost
- CecEvent used when the CEC adapter changes state.
- Flags for CecLogAddrs
- The bitmask of all logical addresses this adapter has claimed.
- CEC logical addresses structure used by CecDevice::set_log and CecDevice::get_log
- CEC message returned from CecDevice::rec and CecDevice::rec_for
- CEC physical address
- Payload of CecOpcode::SetOsdString and CecOpcode::SetOsdName
- PollFlags
poll
These flags define the different events that can be monitored bypoll
andppoll
- PollTimeout
poll
PollTimeout argument for polling.
Enums§
- used by CecOpcode::FeatureAbort
- Event returned by CecDevice::get_event
- The logical address types that the CEC device wants to claim
- The logical addresses defined by CEC 2.0
- Modes for follower
- Modes for initiator
- The opcode of a CecMsg
- Payload of CecOpcode::ReportPowerStatus
- Primary Device Type Operand (prim_devtype)
- parameter for CecOpcode::UserControlPressed
- used by CecOpcode::DeckControl
- used by CecOpcode::DeckStatus
- used by CecOpcode::SetOsdString
- used by CecOpcode::MenuRequest
- used by CecOpcode::Play
- CEC Version Operand for CecOpcode::CecVersion