2.6. ioctls CEC_ADAP_G_LOG_ADDRS and CEC_ADAP_S_LOG_ADDRS¶
2.6.1. Name¶
CEC_ADAP_G_LOG_ADDRS, CEC_ADAP_S_LOG_ADDRS - Get or set the logical addresses
2.6.2. Synopsis¶
-
CEC_ADAP_G_LOG_ADDRS¶
int ioctl(int fd, CEC_ADAP_G_LOG_ADDRS, struct cec_log_addrs *argp)
-
CEC_ADAP_S_LOG_ADDRS¶
int ioctl(int fd, CEC_ADAP_S_LOG_ADDRS, struct cec_log_addrs *argp)
2.6.3. Arguments¶
fd
File descriptor returned by
open()
.argp
Pointer to struct
cec_log_addrs
.
2.6.4. Description¶
To query the current CEC logical addresses, applications call
ioctl CEC_ADAP_G_LOG_ADDRS with a pointer to a
struct cec_log_addrs
where the driver stores the logical addresses.
To set new logical addresses, applications fill in
struct cec_log_addrs
and call ioctl CEC_ADAP_S_LOG_ADDRS
with a pointer to this struct. The ioctl CEC_ADAP_S_LOG_ADDRS
is only available if CEC_CAP_LOG_ADDRS
is set (the ENOTTY
error code is
returned otherwise). The ioctl CEC_ADAP_S_LOG_ADDRS
can only be called by a file descriptor in initiator mode (see ioctls CEC_G_MODE and CEC_S_MODE), if not
the EBUSY
error code will be returned.
To clear existing logical addresses set num_log_addrs
to 0. All other fields
will be ignored in that case. The adapter will go to the unconfigured state and the
cec_version
, vendor_id
and osd_name
fields are all reset to their default
values (CEC version 2.0, no vendor ID and an empty OSD name).
If the physical address is valid (see ioctl CEC_ADAP_S_PHYS_ADDR), then this ioctl will block until all requested logical addresses have been claimed. If the file descriptor is in non-blocking mode then it will not wait for the logical addresses to be claimed, instead it just returns 0.
A CEC_EVENT_STATE_CHANGE event is sent when the logical addresses are claimed or cleared.
Attempting to call ioctl CEC_ADAP_S_LOG_ADDRS when
logical address types are already defined will return with error EBUSY
.
-
type cec_log_addrs¶
__u8 |
|
The actual logical addresses that were claimed. This is set by the
driver. If no logical address could be claimed, then it is set to
|
__u16 |
|
The bitmask of all logical addresses this adapter has claimed. If
this adapter is Unregistered then |
__u8 |
|
The CEC version that this adapter shall use. See
CEC Versions. Used to implement the
|
__u8 |
|
Number of logical addresses to set up. Must be ≤
|
__u32 |
|
The vendor ID is a 24-bit number that identifies the specific
vendor or entity. Based on this ID vendor specific commands may be
defined. If you do not want a vendor ID then set it to
|
__u32 |
|
Flags. See Flags for struct cec_log_addrs for a list of available flags. |
char |
|
The On-Screen Display name as is returned by the
|
__u8 |
|
Primary device type for each logical address. See CEC Primary Device Types for possible types. |
__u8 |
|
Logical address types. See CEC Logical Address Types for possible types. The driver will update this with the actual logical address type that it claimed (e.g. it may have to fallback to CEC_LOG_ADDR_TYPE_UNREGISTERED). |
__u8 |
|
CEC 2.0 specific: the bit mask of all device types. See
CEC All Device Types Flags. It is used in the CEC 2.0
|
__u8 |
|
Features for each logical address. It is used in the CEC 2.0
|
|
1 |
By default if no logical address of the requested type can be claimed, then it will go back to the unconfigured state. If this flag is set, then it will fallback to the Unregistered logical address. Note that if the Unregistered logical address was explicitly requested, then this flag has no effect. |
|
2 |
By default the |
|
4 |
If this flag is set, then the device is CDC-Only. CDC-Only CEC devices are CEC devices that can only handle CDC messages. All other messages are ignored. |
|
4 |
CEC version according to the HDMI 1.3a standard. |
|
5 |
CEC version according to the HDMI 1.4b standard. |
|
6 |
CEC version according to the HDMI 2.0 standard. |
|
0 |
Use for a TV. |
|
1 |
Use for a recording device. |
|
3 |
Use for a device with a tuner. |
|
4 |
Use for a playback device. |
|
5 |
Use for an audio system (e.g. an audio/video receiver). |
|
6 |
Use for a CEC switch. |
|
7 |
Use for a video processor device. |
|
0 |
Use for a TV. |
|
1 |
Use for a recording device. |
|
2 |
Use for a tuner device. |
|
3 |
Use for a playback device. |
|
4 |
Use for an audio system device. |
|
5 |
Use for a second TV or for a video processor device. |
|
6 |
Use this if you just want to remain unregistered. Used for pure CEC switches or CDC-only devices (CDC: Capability Discovery and Control). |
|
0x80 |
This supports the TV type. |
|
0x40 |
This supports the Recording type. |
|
0x20 |
This supports the Tuner type. |
|
0x10 |
This supports the Playback type. |
|
0x08 |
This supports the Audio System type. |
|
0x04 |
This supports the CEC Switch or Video Processing type. |
2.6.5. Return Value¶
On success 0 is returned, on error -1 and the errno
variable is set
appropriately. The generic error codes are described at the
Generic Error Codes chapter.
The ioctl CEC_ADAP_S_LOG_ADDRS can return the following error codes:
- ENOTTY
The
CEC_CAP_LOG_ADDRS
capability wasn’t set, so this ioctl is not supported.- EBUSY
The CEC adapter is currently configuring itself, or it is already configured and
num_log_addrs
is non-zero, or another filehandle is in exclusive follower or initiator mode, or the filehandle is in modeCEC_MODE_NO_INITIATOR
.- EINVAL
The contents of struct
cec_log_addrs
is invalid.