It seems like the there is a mismatch of how libcec defines cec_logical_addresses and how CecLogicalAddresses interprets them.
libcec defines cec_logical_addresses as:
struct {
cec_logical_address primary; /*< the primary logical address to use /
int addresses[16]; /*< the list of addresses /
}
Unfortunately the comment /**< the list of addresses */ is extremely misleading. It should actually be called a bit map rather than a list where the keys are logical addresses and the values are booleans that indicate if the address is present. This behavior is visible in the implementation for Set():
It seems like the there is a mismatch of how libcec defines
cec_logical_addresses
and howCecLogicalAddresses
interprets them.libcec defines cec_logical_addresses as: struct { cec_logical_address primary; /*< the primary logical address to use / int addresses[16]; /*< the list of addresses / }
Unfortunately the comment
/**< the list of addresses */
is extremely misleading. It should actually be called a bit map rather than a list where the keys are logical addresses and the values are booleans that indicate if the address is present. This behavior is visible in the implementation for Set():https://github.com/Pulse-Eight/libcec/blob/76551ea1dd9a55f0ce1533e440dc12dbc594f7ba/include/cectypes.h#L1312-L1318
On the other hand cec-rs interprets the struct as list of logical addresses (where the primary address lives on its own).