amber 1.2.0

corrected bug when pairing 2 even devices
This commit is contained in:
LX3JL 2017-11-06 15:29:53 +01:00
parent 18100726a5
commit 35b8fd1261
2 changed files with 11 additions and 11 deletions

View File

@ -95,28 +95,28 @@ int CFtdiDeviceDescr::CreateInterfacePair(CFtdiDeviceDescr *descr1, CFtdiDeviceD
int iNbChs = 0;
// create interface objects
if ( (descr1->GetNbChannels() == 1) && (descr1->GetNbChannels() == 1) )
if ( (descr1->GetNbChannels() == 1) && (descr2->GetNbChannels() == 1) )
{
// create 3000-3000 pair
CUsb3000Interface *Usb3000A = InstantiateUsb3000(descr1);
CUsb3000Interface *Usb3000B = InstantiateUsb3000(descr2);
iNbChs = CreatePair(Usb3000A, Usb3000B, channels);
}
else if ( (descr1->GetNbChannels() == 3) && (descr1->GetNbChannels() == 1) )
else if ( (descr1->GetNbChannels() == 3) && (descr2->GetNbChannels() == 1) )
{
// create 3003-3000 pair
CUsb3003Interface *Usb3003 = InstantiateUsb3003(descr1);
CUsb3000Interface *Usb3000 = InstantiateUsb3000(descr2);
iNbChs = CreatePair(Usb3003, Usb3000, channels);
}
else if ( (descr1->GetNbChannels() == 1) && (descr1->GetNbChannels() == 3) )
else if ( (descr1->GetNbChannels() == 1) && (descr2->GetNbChannels() == 3) )
{
// create 3000-3003 pair
CUsb3000Interface *Usb3000 = InstantiateUsb3000(descr1);
CUsb3003Interface *Usb3003 = InstantiateUsb3003(descr2);
iNbChs = CreatePair(Usb3003, Usb3000, channels);
}
else if ( (descr1->GetNbChannels() == 3) && (descr1->GetNbChannels() == 3) )
else if ( (descr1->GetNbChannels() == 3) && (descr2->GetNbChannels() == 3) )
{
// create 3003-3003 pair
CUsb3003Interface *Usb3003A = InstantiateUsb3003(descr1);
@ -390,7 +390,7 @@ int CFtdiDeviceDescr::CreatePair(CUsb3000Interface *Usb3000A, CUsb3000Interface
Usb3000A->AddChannel(Channel);
Usb3000B->AddChannel(Channel);
// ch2
Channel = new CVocodecChannel(Usb3000A, 0, Usb3000B, 0, CODECGAIN_AMBE2PLUS);
Channel = new CVocodecChannel(Usb3000B, 0, Usb3000A, 0, CODECGAIN_AMBE2PLUS);
channels->push_back(Channel);
Usb3000A->AddChannel(Channel);
Usb3000B->AddChannel(Channel);

View File

@ -95,7 +95,7 @@ bool CUsb3003DF2ETInterface::ResetDevice(void)
int len, i;
char rxpacket[100];
std::cout << "Trying DF2ET-3003 soft reset" << std::endl;
std::cout << "Trying AMBE3003USB soft reset" << std::endl;
DWORD n, b;
char txpacket[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@ -135,13 +135,13 @@ bool CUsb3003DF2ETInterface::ResetDevice(void)
ok = ((len == 7) && (rxpacket[4] == PKT_READY));
if ( ok )
{
std::cout << "DF2ET-3003 soft reset succeeded" << std::endl;
std::cout << "AMBE3003USB soft reset succeeded" << std::endl;
}
else
{
std::cout << "DF2ET-3003 soft reset failed" << std::endl;
std::cout << "AMBE3003USB soft reset failed" << std::endl;
std::cout << "Trying DF2ET-3003 hard reset" << std::endl;
std::cout << "Trying AMBE3003USB hard reset" << std::endl;
ftStatus = FT_ClrDtr( m_FtdiHandle );
CTimePoint::TaskSleepFor(10);
@ -152,11 +152,11 @@ bool CUsb3003DF2ETInterface::ResetDevice(void)
ok = ((len == 7) && (rxpacket[4] == PKT_READY));
if ( ok )
{
std::cout << "DF2ET-3003 hard reset succeeded" << std::endl;
std::cout << "AMBE3003USB hard reset succeeded" << std::endl;
}
else
{
std::cout << "DF2ET-3003 hard reset failed" << std::endl;
std::cout << "AMBE3003USB hard reset failed" << std::endl;
}
}
return ok;