From defb76bb4e9f3eafd65cfabb2562a53c4743f5a4 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 19 Jan 2022 17:31:57 -0700 Subject: [PATCH] check the config'ed modules after we know what we have for hardware --- Controller.cpp | 40 +++++++++++----------------------------- Controller.h | 1 - 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index 5366962..26dfaf7 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -55,30 +55,6 @@ void CController::Stop() dmrsf_device.reset(); } -bool CController::CheckTCModules() const -{ - // make sure the configured transcoded modules seems okay - const std::string modules(TRANSCODED_MODULES); - bool trouble = false; - - if (modules.size() > 3) - { - std::cerr << "Too many transcoded modules defined!" << std::endl; - trouble = true; - } - - for (unsigned int i =0; i 'Z') { - std::cerr << "Transcoded modules[" << i << "] is not an uppercase letter!" << std::endl; - trouble = true; - } - } - - return trouble; -} - bool CController::DiscoverFtdiDevices(std::list> &found) { int iNbDevices = 0; @@ -124,9 +100,6 @@ bool CController::DiscoverFtdiDevices(std::list(new CCodec2(true)); } - // the 3003 devices + // the 3000 or 3003 devices std::list> deviceset; if (DiscoverFtdiDevices(deviceset)) @@ -148,7 +121,7 @@ bool CController::InitVocoders() if (2 != deviceset.size()) { - std::cerr << "You need exactly two DVSI 3003 devices" << std::endl; + std::cerr << "Could not find exactly two DVSI devices" << std::endl; return true; } @@ -171,6 +144,15 @@ bool CController::InitVocoders() return true; } + for (unsigned int i=0; i 'Z') { + std::cerr << "Transcoded modules[" << i << "] is not an uppercase letter!" << std::endl; + return true; + } + } + //initialize each device while (! deviceset.empty()) { diff --git a/Controller.h b/Controller.h index 5436379..4b4a6b8 100644 --- a/Controller.h +++ b/Controller.h @@ -60,7 +60,6 @@ protected: // processing threads void ReadReflectorThread(); void ProcessC2Thread(); - bool CheckTCModules() const; void Codec2toAudio(std::shared_ptr packet); void AudiotoCodec2(std::shared_ptr packet); void SendToReflector(std::shared_ptr packet);