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
- capabilities of the CEC adapter
- CecCaps
- information about the CEC adapter
- CecDevice
- A handle on a CEC device.
- CecEvent
Lost Msgs - CecEvent that tells you how many messages were lost
- CecEvent
State Change - CecEvent used when the CEC adapter changes state.
- CecLog
Addr Flags - Flags for CecLogAddrs
- CecLog
Addr Mask - The bitmask of all logical addresses this adapter has claimed.
- CecLog
Addrs - CEC logical addresses structure used by CecDevice::set_log and CecDevice::get_log
- CecMsg
- CEC message returned from CecDevice::rec and CecDevice::rec_for
- CecPhysical
Address - CEC physical address
- CecTimer
- Payload of CecOpcode::SetAnalogueTimer, CecOpcode::SetDigitalTimer or CecOpcode::SetExtTimer
- OSDStr
- Payload of CecOpcode::SetOsdString and CecOpcode::SetOsdName
- Poll
Flags poll
- These flags define the different events that can be monitored by
poll
andppoll
- Poll
Timeout poll
- PollTimeout argument for polling.
- Recording
Sequence - Payload of CecOpcode::SetAnalogueTimer, CecOpcode::SetDigitalTimer or CecOpcode::SetExtTimer
- VendorID
Enums§
- CecAbort
Reason - used by CecOpcode::FeatureAbort
- CecEvent
- Event returned by CecDevice::get_event
- CecLog
Addr Type - The logical address types that the CEC device wants to claim
- CecLogical
Address - The logical addresses defined by CEC 2.0
- CecMode
Follower - Modes for follower
- CecMode
Initiator - Modes for initiator
- CecOpcode
- The opcode of a CecMsg
- CecPower
Status - Payload of CecOpcode::ReportPowerStatus
- CecPrim
DevType - Primary Device Type Operand (prim_devtype)
- CecUser
Control Code - parameter for CecOpcode::UserControlPressed
- Deck
Control Mode - used by CecOpcode::DeckControl
- Deck
Info - used by CecOpcode::DeckStatus
- Display
Control - used by CecOpcode::SetOsdString
- Menu
Request Type - used by CecOpcode::MenuRequest
- Play
Mode - used by CecOpcode::Play
- Status
Request - used by CecOpcode::GiveDeckStatus and CecOpcode::GiveTunerDeviceStatus
- Version
- CEC Version Operand for CecOpcode::CecVersion