![]() |
libCEC 8.1.0
C / C++ API — control CEC-capable HDMI devices
|
#include <cectypes.h>
Public Member Functions | |
| cec_command (void) | |
| cec_command & | operator= (const struct cec_command &command) |
| uint8_t | Size (void) const |
| int | Serialize (uint8_t *buffer, uint8_t iBufSize, bool bWithHeader=true) const |
| Serialize this command as an on-wire CEC frame: [header][opcode][operands...]. | |
| void | PushBack (uint8_t data) |
| Push a byte to the back of this command. | |
| void | Clear (void) |
| Clear this command, resetting everything to the default values. | |
| void | PushArray (size_t len, const uint8_t *data) |
Static Public Member Functions | |
| static void | Format (cec_command &command, cec_logical_address initiator, cec_logical_address destination, cec_opcode opcode, int32_t timeout=1000) |
| Formats a cec_command. | |
| static cec_opcode | GetResponseOpcode (cec_opcode opcode) |
Public Attributes | |
| cec_logical_address | initiator |
| the logical address of the initiator of this message | |
| cec_logical_address | destination |
| the logical address of the destination of this message | |
| int8_t | ack |
| 1 when the ACK bit is set, 0 otherwise | |
| int8_t | eom |
| 1 when the EOM bit is set, 0 otherwise | |
| cec_opcode | opcode |
| the opcode of this message | |
| cec_datapacket | parameters |
| the parameters attached to this message | |
| int8_t | opcode_set |
| 1 when an opcode is set, 0 otherwise (POLL message) | |
| int32_t | transmit_timeout |
| the timeout to use in ms | |
Definition at line 1092 of file cectypes.h.
|
inline |
Definition at line 1104 of file cectypes.h.
|
inline |
Definition at line 1109 of file cectypes.h.
|
inline |
Definition at line 1123 of file cectypes.h.
|
inline |
Serialize this command as an on-wire CEC frame: [header][opcode][operands...].
The frame is capped to a single CEC frame (CEC_MAX_FRAME_SIZE bytes) and to the destination buffer; a command that does not fit is rejected rather than truncated or overrunning the buffer. This is the single place where the transmit length is bounded, so adapter backends do not need their own size checks.
| buffer | The destination buffer. |
| iBufSize | The size of the destination buffer, in bytes. |
| bWithHeader | When true (default), byte 0 is the initiator/destination header. When false, serialization starts at the opcode, for backends that carry the addressing in a separate field (e.g. the kernel cec_msg or the TDA995x frame header). |
Definition at line 1143 of file cectypes.h.
|
inlinestatic |
Formats a cec_command.
| command | The command to format. |
| initiator | The logical address of the initiator. |
| destination | The logical address of the destination. |
| opcode | The opcode of the command. |
| timeout | The transmission timeout. |
Definition at line 1171 of file cectypes.h.
|
inline |
Push a byte to the back of this command.
| data | The byte to push. |
Definition at line 1188 of file cectypes.h.
|
inline |
Clear this command, resetting everything to the default values.
Definition at line 1207 of file cectypes.h.
|
inlinestatic |
Definition at line 1219 of file cectypes.h.
|
inline |
Definition at line 1256 of file cectypes.h.
| cec_logical_address cec_command::initiator |
the logical address of the initiator of this message
Definition at line 1094 of file cectypes.h.
| cec_logical_address cec_command::destination |
the logical address of the destination of this message
Definition at line 1095 of file cectypes.h.
| int8_t cec_command::ack |
1 when the ACK bit is set, 0 otherwise
Definition at line 1096 of file cectypes.h.
| int8_t cec_command::eom |
1 when the EOM bit is set, 0 otherwise
Definition at line 1097 of file cectypes.h.
| cec_opcode cec_command::opcode |
the opcode of this message
Definition at line 1098 of file cectypes.h.
| cec_datapacket cec_command::parameters |
the parameters attached to this message
Definition at line 1099 of file cectypes.h.
| int8_t cec_command::opcode_set |
1 when an opcode is set, 0 otherwise (POLL message)
Definition at line 1100 of file cectypes.h.
| int32_t cec_command::transmit_timeout |
the timeout to use in ms
Definition at line 1101 of file cectypes.h.