From ee0655a85125ac2cd9f88a95d6f2208440f703c6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 13 Jul 2020 04:12:15 +0200 Subject: [PATCH] Device API: fixed renumerateChannels in case of MIMO --- sdrbase/device/deviceapi.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index 0e83105a4..17e3949ee 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -867,16 +867,18 @@ void DeviceAPI::renumerateChannels() for (; index < m_channelSourceAPIs.size() + m_channelSinkAPIs.size(); ++index) { - m_channelSourceAPIs.at(index)->setIndexInDeviceSet(index); - m_channelSourceAPIs.at(index)->setDeviceSetIndex(m_deviceTabIndex); - m_channelSourceAPIs.at(index)->setDeviceAPI(this); + int sourceIndex = index - m_channelSinkAPIs.size(); + m_channelSourceAPIs.at(sourceIndex)->setIndexInDeviceSet(index); + m_channelSourceAPIs.at(sourceIndex)->setDeviceSetIndex(m_deviceTabIndex); + m_channelSourceAPIs.at(sourceIndex)->setDeviceAPI(this); } for (; index < m_mimoChannelAPIs.size() + m_channelSourceAPIs.size() + m_channelSinkAPIs.size(); ++index) { - m_mimoChannelAPIs.at(index)->setIndexInDeviceSet(index); - m_mimoChannelAPIs.at(index)->setDeviceSetIndex(m_deviceTabIndex); - m_mimoChannelAPIs.at(index)->setDeviceAPI(this); + int mimoIndex = index - m_channelSourceAPIs.size() - m_channelSinkAPIs.size(); + m_mimoChannelAPIs.at(mimoIndex)->setIndexInDeviceSet(index); + m_mimoChannelAPIs.at(mimoIndex)->setDeviceSetIndex(m_deviceTabIndex); + m_mimoChannelAPIs.at(mimoIndex)->setDeviceAPI(this); } } } \ No newline at end of file