Skip to main content

CecMsg

Struct CecMsg 

Source
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: u32

The 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: u32

The framework assigns a sequence number to messages that are sent. This can be used to track replies to previously sent messages.

§reply: CecOpcode

This 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: RxStatus

The message receive status bits. Set by the driver.

§tx_status: TxStatus

The message transmit status bits. Set by the driver.

Implementations§

Source§

impl CecMsg

Source

pub fn initiator(&self) -> CecLogicalAddress

return the initiator’s logical address

Source

pub fn destination(&self) -> CecLogicalAddress

return the destination’s logical address

Source

pub fn opcode( &self, ) -> Option<Result<CecOpcode, TryFromPrimitiveError<CecOpcode>>>

return the opcode of the message, None for poll

Source

pub fn parameters(&self) -> &[u8]

Source

pub fn is_broadcast(&self) -> bool

return true if this is a broadcast message

Source

pub fn is_ok(&self) -> bool

Source

pub fn init(from: CecLogicalAddress, to: CecLogicalAddress) -> CecMsg

Trait Implementations§

Source§

impl Debug for CecMsg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.