1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2024-12-23 18:15:46 -05:00

ambed 1.3.4

Solved issue when pairing a 3003 with a 3000.
Solved issue when aggregating more than 2 devices
This commit is contained in:
LX3JL 2019-10-22 19:45:20 +02:00
parent f643fc512a
commit df41211a11
4 changed files with 53 additions and 13 deletions

0
ambed/cstream.cpp Executable file → Normal file
View File

View File

@ -117,11 +117,12 @@ bool CVocodecs::Init(void)
{
descr2 = m_FtdiDeviceDescrs[j];
found = (!descr2->IsUsed() && (descr2->GetNbChannels() == 1));
j++;
}
// found one ?
if ( found )
{
// yes, create and pairboth interfaces
// yes, create and pair both interfaces
iNbCh += CFtdiDeviceDescr::CreateInterfacePair(descr1, descr2, &PairsOf3000DevicesChs);
// and flag as used
descr1->SetUsed(true);
@ -138,24 +139,54 @@ bool CVocodecs::Init(void)
CFtdiDeviceDescr *descr2 = NULL;
if ( !descr1->IsUsed() && (descr1->GetNbChannels() == 3) )
{
// any other odd channel device to pair with ?
// any other single channel device to pair with ?
// any other 3 channel device to pair with ?
bool found = false;
int j = i+1;
while ( !found && (j < m_FtdiDeviceDescrs.size()) )
{
descr2 = m_FtdiDeviceDescrs[j];
found = (!descr2->IsUsed() && IsOdd(descr2->GetNbChannels()));
found = (!descr2->IsUsed() && (descr2->GetNbChannels() == 3));
j++;
}
// found one ?
if ( found )
{
// yes, create and pairboth interfaces
// yes, create and pair both interfaces
iNbCh += CFtdiDeviceDescr::CreateInterfacePair(descr1, descr2, &Multi3003DevicesChs);
// and flag as used
descr1->SetUsed(true);
descr2->SetUsed(true);
}
}
}
// at this point we should have only remaining an unique 3 channels
// and or a unique single channel
std::vector<CVocodecChannel *> Combined3003And3000DeviceChannels;
for ( int i = 0; i < m_FtdiDeviceDescrs.size(); i++ )
{
CFtdiDeviceDescr *descr1 = m_FtdiDeviceDescrs[i];
CFtdiDeviceDescr *descr2 = NULL;
// Any 3003 ?
if ( !descr1->IsUsed() && (descr1->GetNbChannels() == 3) )
{
// any single channel device to pair with ?
bool found = false;
int j = 0;
while ( !found && (j < m_FtdiDeviceDescrs.size()) )
{
descr2 = m_FtdiDeviceDescrs[j];
found = ((descr1 != descr2) && !descr2->IsUsed() && (descr2->GetNbChannels() == 1));
j++;
}
// found one ?
if ( found )
{
// yes, create and pair both interfaces
iNbCh += CFtdiDeviceDescr::CreateInterfacePair(descr1, descr2, &Combined3003And3000DeviceChannels);
// and flag as used
descr1->SetUsed(true);
descr2->SetUsed(true);
}
else
{
// no, just create a standalone 3003 interface
@ -165,10 +196,11 @@ bool CVocodecs::Init(void)
}
}
}
// at this point we should possible only have unique 3003 remaining
// now agregate channels by order of priority
// for proper load sharing
// pairs of 300 devices first
// pairs of 3000 devices first
{
for ( int i = 0; i < PairsOf3000DevicesChs.size(); i++ )
{
@ -184,11 +216,11 @@ bool CVocodecs::Init(void)
}
Single3003DeviceChannels.clear();
}
// and finally interlace multi-3003 and pairs of 3003 devices which always
// finally interlace multi-3003 and pairs of 3003 devices which always
// results to 6 channels per pair of 3003
{
int n = (int)Multi3003DevicesChs.size() / 6;
for ( int i = 0; i < 6; i++ )
for ( int i = 0; (i < 6) && (n != 0); i++ )
{
for ( int j = 0; j < n; j++ )
{
@ -197,7 +229,15 @@ bool CVocodecs::Init(void)
}
Multi3003DevicesChs.clear();
}
// and finaly the hybrid combination of 3003 / 3000
{
for ( int i = 0; i < Combined3003And3000DeviceChannels.size(); i++ )
{
m_Channels.push_back(Combined3003And3000DeviceChannels.at(i));
}
Combined3003And3000DeviceChannels.clear();
}
// done
if ( ok )

2
ambed/main.h Executable file → Normal file
View File

@ -49,7 +49,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 3
#define VERSION_REVISION 4
// global ------------------------------------------------------

View File

@ -22,7 +22,7 @@
// along with Foobar. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------
VERSION: 1.3.2
VERSION: 1.3.4
Hardware compatibility.
======================
@ -44,7 +44,7 @@ device DMR->DSTAR DSTAR->DMR Nb Of concurrent channels
3000(pair) 1 1 2
3003 1 1 2
3003(pair) 3 3 4
3003-3000(pair) 2 2 not tested
3003-3000(pair) 2 2 4
3006 3 3 6
3012 6 6 12