bluez5: in SelectProperties, parse QoS values and pass to get_qos

The codec may need to take into account endpoint preferred QoS values,
so parse this information and pass it to the codec's get_qos.

All the QoS struct values need to be set, as otherwise BlueZ may pass
uninitialized zero values over the air, which devices can reject.  This
does not apply to CIG/CIS ids, which are automatically allocated by
default.

Fixes connecting to nrf5340 devkit, which requires a valid TargetLatency
value.
This commit is contained in:
Pauli Virtanen 2022-10-09 20:49:43 +03:00 committed by Wim Taymans
parent 61453b91bd
commit 9846e0cb7a
4 changed files with 225 additions and 120 deletions

View file

@ -110,4 +110,33 @@ typedef struct {
uint8_t n_blks;
} __attribute__ ((packed)) bap_lc3_t;
#define BT_ISO_QOS_CIG_UNSET 0xff
#define BT_ISO_QOS_CIS_UNSET 0xff
#define BT_ISO_QOS_TARGET_LATENCY_LOW 0x01
#define BT_ISO_QOS_TARGET_LATENCY_BALANCED 0x02
#define BT_ISO_QOS_TARGET_LATENCY_RELIABILITY 0x03
struct bap_endpoint_qos {
uint8_t framing;
uint8_t phy;
uint8_t retransmission;
uint16_t latency;
uint32_t delay_min;
uint32_t delay_max;
uint32_t preferred_delay_min;
uint32_t preferred_delay_max;
};
struct bap_codec_qos {
uint32_t interval;
uint8_t framing;
uint8_t phy;
uint16_t sdu;
uint8_t retransmission;
uint16_t latency;
uint32_t delay;
uint8_t target_latency;
};
#endif