emulator: Use master settings for CIS params
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 26 May 2020 16:41:00 +0000 (09:41 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:49 +0000 (14:30 +0530)
The slave will be the first to respond with CIS Estabished but only the
master has the CIG params set so this switch to master so parameters are
proper.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/btdev.c

index 3fb860855f7ada7d463c895783c1aa6c264afb72..066c5630a77949814a84be797e8afa8139959584 100755 (executable)
@@ -1417,6 +1417,9 @@ static void le_cis_estabilished(struct btdev *dev, uint8_t status)
 
        evt.status = status;
 
+       if (dev->conn)
+               dev = dev->conn;
+
        if (!evt.status) {
                evt.conn_handle = cpu_to_le16(ISO_HANDLE);
                /* TODO: Figure out if these values makes sense */
@@ -1435,8 +1438,8 @@ static void le_cis_estabilished(struct btdev *dev, uint8_t status)
                evt.s_bn = 0x01;
                evt.m_ft = 0x01;
                evt.s_ft = 0x01;
-               evt.m_mtu = dev->iso_mtu;
-               evt.s_mtu = dev->iso_mtu;
+               evt.m_mtu = dev->le_cig.cis.m_sdu;
+               evt.s_mtu = dev->le_cig.cis.s_sdu;
                evt.interval = dev->le_cig.params.m_latency;
        }