From a7a6d7358b28b55142536c6c2b4eee9d88a5f0b8 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 15 Dec 2021 08:52:29 -0700 Subject: [PATCH] more complete vocoder config response check --- Controller.cpp | 16 ++++++++-------- DV3003.cpp | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index 31f3d79..4161c74 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -422,6 +422,7 @@ void CController::ReadDevice(std::shared_ptr device, EAmbeType type) } } +#ifdef DEBUG void CController::AppendWave(const std::shared_ptr packet) const { std::stringstream sstr; @@ -437,7 +438,6 @@ void CController::AppendWave(const std::shared_ptr packet) co std::cerr << "could not open pcm file " << sstr.str(); } -#ifdef DEBUG void CController::Dump(const std::shared_ptr p, const std::string &title) const { std::string codec; @@ -480,13 +480,13 @@ void CController::Dump(const std::shared_ptr p, const std::st // std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetDMRData()+i)); // std::cout << std::endl; // } - if (p->M17IsSet()) - { - std::cout << "M17 Data: "; - for (unsigned int i=0; i<16; i++) - std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetM17Data()+i)); - std::cout << std::endl; - } + // if (p->M17IsSet()) + // { + // std::cout << "M17 Data: "; + // for (unsigned int i=0; i<16; i++) + // std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetM17Data()+i)); + // std::cout << std::endl; + // } std::cout << std::dec; } diff --git a/DV3003.cpp b/DV3003.cpp index e833d43..3c1057f 100644 --- a/DV3003.cpp +++ b/DV3003.cpp @@ -263,6 +263,8 @@ bool CDV3003::ConfigureCodec(uint8_t pkt_ch, Encoding type) } if ((ntohs(responsePacket.header.payload_length) != 6) || + (responsePacket.field_id != pkt_ch) || + (responsePacket.payload.ctrl.data.resp[0] != 0x00) || (responsePacket.payload.ctrl.data.resp[1] != PKT_RATEP) || (responsePacket.payload.ctrl.data.resp[2] != 0x00) || (responsePacket.payload.ctrl.data.resp[3] != PKT_INIT) ||