From ca057dd18526923496da8f9faf4ee864521b6388 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Thu, 13 Jan 2022 04:47:16 -0700 Subject: [PATCH] renamed a few things --- Controller.cpp | 12 ++++++------ Controller.h | 6 ++---- DV3003.cpp | 10 +++++----- DV3003.h | 2 +- README.md | 4 ++-- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index 2d65327..88007df 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -52,7 +52,7 @@ void CController::Stop() reader.Close(); dstar_device.CloseDevice(); - dmr_device.CloseDevice(); + dmrsf_device.CloseDevice(); } bool CController::CheckTCModules() const @@ -157,13 +157,13 @@ bool CController::InitDevices() { dstar_device.OpenDevice(deviceset.front().first, deviceset.front().second, 921600); deviceset.pop_front(); - dmr_device.OpenDevice(deviceset.front().first, deviceset.front().second, 921600); + dmrsf_device.OpenDevice(deviceset.front().first, deviceset.front().second, 921600); deviceset.pop_front(); } // and start them up! dstar_device.Start(); - dmr_device.Start(); + dmrsf_device.Start(); deviceset.clear(); @@ -190,7 +190,7 @@ void CController::ReadReflectorThread() dstar_device.AddPacket(packet); break; case ECodecType::dmr: - dmr_device.AddPacket(packet); + dmrsf_device.AddPacket(packet); break; case ECodecType::c2_1600: case ECodecType::c2_3200: @@ -284,7 +284,7 @@ void CController::Codec2toAudio(std::shared_ptr packet) } // the only thing left is to encode the two ambe, so push the packet onto both AMBE queues dstar_device.AddPacket(packet); - dmr_device.AddPacket(packet); + dmrsf_device.AddPacket(packet); } void CController::ProcessC2Thread() @@ -329,7 +329,7 @@ void CController::RouteDstPacket(std::shared_ptr packet) { // codec_in is dstar, the audio has just completed, so now calc the M17 and DMR codec2_queue.push(packet); - dmr_device.AddPacket(packet); + dmrsf_device.AddPacket(packet); } else if (packet->AllCodecsAreSet()) { diff --git a/Controller.h b/Controller.h index e860a04..c4e1d86 100644 --- a/Controller.h +++ b/Controller.h @@ -29,12 +29,10 @@ #include "UnixDgramSocket.h" #include "configure.h" -enum class EAmbeType { dstar, dmr }; - class CController { public: - std::mutex dstar_mux, dmr_mux; + std::mutex dstar_mux, dmrsf_mux; CController(); bool Start(); @@ -52,7 +50,7 @@ protected: CUnixDgramWriter writer; std::unordered_map> c2_16, c2_32; CDV3003 dstar_device{Encoding::dstar}; - CDV3003 dmr_device{Encoding::dmr}; + CDV3003 dmrsf_device{Encoding::dmrsf}; CPacketQueue codec2_queue; std::mutex send_mux; diff --git a/DV3003.cpp b/DV3003.cpp index affd413..595c16b 100644 --- a/DV3003.cpp +++ b/DV3003.cpp @@ -201,7 +201,7 @@ bool CDV3003::OpenDevice(const std::string &serialno, const std::string &desc, i } } - status = FT_SetBaudRate(ftHandle, baudrate ); + status = FT_SetBaudRate(ftHandle, baudrate); if (status != FT_OK) { FTDI_Error("FT_SetBaudRate", status); @@ -221,7 +221,7 @@ bool CDV3003::OpenDevice(const std::string &serialno, const std::string &desc, i return true; } - status = FT_SetTimeouts(ftHandle, 200, 200 ); + status = FT_SetTimeouts(ftHandle, 200, 200); if (status != FT_OK) { FTDI_Error("FT_SetTimeouts", status); @@ -229,7 +229,7 @@ bool CDV3003::OpenDevice(const std::string &serialno, const std::string &desc, i } description.assign(desc); - description.append(": "); + description.append(":"); description.append(serialno); std::cout << "Opened " << description << std::endl; @@ -610,9 +610,9 @@ void CDV3003::ReadDevice() } else { - Controller.dmr_mux.lock(); + Controller.dmrsf_mux.lock(); Controller.RouteDmrPacket(packet); - Controller.dmr_mux.unlock(); + Controller.dmrsf_mux.unlock(); } } } diff --git a/DV3003.h b/DV3003.h index 7903092..9ce586a 100644 --- a/DV3003.h +++ b/DV3003.h @@ -98,7 +98,7 @@ struct dv3003_packet { using SDV3003_Packet = struct dv3003_packet; -enum class Encoding { dstar, dmr }; +enum class Encoding { dstar, dmrsf }; class CDV3003 { public: diff --git a/README.md b/README.md index 001861b..13814e1 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ This will build a new kind of hybrid transcoder that uses AMBE DVSI-based hardwa This is the only transcoder that will work with the [URF reflector](https://github.com/n7tae/urfd). -This software is loosely based on LX3JL's **ambed**, but is easily different enough to be considered an entirely original work. Here are some major differences: +This software is loosely based on LX3JL's **ambed**, but is easily different enough to be considered an entirely original work. Here are some major differences with ambed: -- tcd mixes both hardware-based and software-based vocoders, providing a bridge between the closed source vocoders used in DStar, DMR and YSF and open-source vocoders used in M17. +- tcd uses both hardware-based and software-based vocoders, providing a bridge between the closed source vocoders used in DStar, DMR and YSF and open-source vocoders used in M17. - **UNIX Sockets** are used to communicate between the reflector and this transcoder. This greatly simplifies the code and *significantly* improves transcoding performance. - AMBE vocoders are dedicated to an assigned reflector channel. This prevents overloading when processing multiple voice streams and provides the best possible performance for the reflector's clients.