pub struct CecMsg {
pub timeout: u32,
pub sequence: u32,
pub reply: CecOpcode,
pub rx_status: RxStatus,
pub tx_status: TxStatus,
/* private fields */
}Expand description
CEC message returned from CecDevice::rec and CecDevice::rec_for
Fields§
§timeout: u32The timeout (in ms) that is used to timeout CEC_RECEIVE. Set to 0 if you want to wait forever. This timeout can also be used with CEC_TRANSMIT as the timeout for waiting for a reply. If 0, then it will use a 1 second timeout instead of waiting forever as is done with CEC_RECEIVE.
sequence: u32The framework assigns a sequence number to messages that are sent. This can be used to track replies to previously sent messages.
reply: CecOpcodeThis field is ignored with CEC_RECEIVE and is only used by CEC_TRANSMIT. If non-zero, then wait for a reply with this opcode. Set to CEC_MSG_FEATURE_ABORT if you want to wait for a possible ABORT reply.
If there was an error when sending the msg or FeatureAbort was returned, then reply is set to 0.
If reply is non-zero upon return, then len/msg are set to the received message. If reply is zero upon return and status has the CEC_TX_STATUS_FEATURE_ABORT bit set, then len/msg are set to the received feature abort message. If reply is zero upon return and status has the CEC_TX_STATUS_MAX_RETRIES bit set, then no reply was seen at all. If reply is non-zero for CEC_TRANSMIT and the message is a broadcast, then -EINVAL is returned. if reply is non-zero, then timeout is set to 1000 (the required maximum response time).
rx_status: RxStatusThe message receive status bits. Set by the driver.
tx_status: TxStatusThe message transmit status bits. Set by the driver.
Implementations§
Source§impl CecMsg
impl CecMsg
Sourcepub fn initiator(&self) -> CecLogicalAddress
pub fn initiator(&self) -> CecLogicalAddress
return the initiator’s logical address
Sourcepub fn destination(&self) -> CecLogicalAddress
pub fn destination(&self) -> CecLogicalAddress
return the destination’s logical address
Sourcepub fn opcode(
&self,
) -> Option<Result<CecOpcode, TryFromPrimitiveError<CecOpcode>>>
pub fn opcode( &self, ) -> Option<Result<CecOpcode, TryFromPrimitiveError<CecOpcode>>>
return the opcode of the message, None for poll
pub fn parameters(&self) -> &[u8] ⓘ
Sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
return true if this is a broadcast message