From 474e9fdbb7f92bcf974d89490adcf1d90f83dac6 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 23 May 2024 14:27:52 +0100 Subject: [PATCH] Simplify the FM protocol to match the FM Gateway. --- Conf.cpp | 26 +-- Conf.h | 8 +- FMNetwork.cpp | 500 +++++++------------------------------------------- FMNetwork.h | 31 +--- MMDVMHost.cpp | 13 +- Makefile | 2 - 6 files changed, 75 insertions(+), 505 deletions(-) diff --git a/Conf.cpp b/Conf.cpp index a4de83d..449dfec 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2023 by Jonathan Naylor G4KLX + * Copyright (C) 2015-2024 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -383,9 +383,6 @@ m_pocsagNetworkDebug(false), #endif #if defined(USE_FM) m_fmNetworkEnabled(false), -m_fmNetworkProtocol("USRP"), -m_fmNetworkSampleRate(48000U), -m_fmNetworkSquelchFile(), m_fmGatewayAddress(), m_fmGatewayPort(0U), m_fmLocalAddress(), @@ -1181,12 +1178,6 @@ bool CConf::read() } else if (section == SECTION_FM_NETWORK) { if (::strcmp(key, "Enable") == 0) m_fmNetworkEnabled = ::atoi(value) == 1; - else if (::strcmp(key, "Protocol") == 0) - m_fmNetworkProtocol = value; - else if (::strcmp(key, "SampleRate") == 0) - m_fmNetworkSampleRate = (unsigned int)::atoi(value); - else if (::strcmp(key, "SquelchFile") == 0) - m_fmNetworkSquelchFile = value; else if (::strcmp(key, "LocalAddress") == 0) m_fmLocalAddress = value; else if (::strcmp(key, "LocalPort") == 0) @@ -2388,21 +2379,6 @@ bool CConf::getFMNetworkEnabled() const return m_fmNetworkEnabled; } -std::string CConf::getFMNetworkProtocol() const -{ - return m_fmNetworkProtocol; -} - -unsigned int CConf::getFMNetworkSampleRate() const -{ - return m_fmNetworkSampleRate; -} - -std::string CConf::getFMNetworkSquelchFile() const -{ - return m_fmNetworkSquelchFile; -} - std::string CConf::getFMGatewayAddress() const { return m_fmGatewayAddress; diff --git a/Conf.h b/Conf.h index 3e50b29..86c7f34 100644 --- a/Conf.h +++ b/Conf.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2023 by Jonathan Naylor G4KLX + * Copyright (C) 2015-2024 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -358,9 +358,6 @@ public: #if defined(USE_FM) // The FM Network section bool getFMNetworkEnabled() const; - std::string getFMNetworkProtocol() const; - unsigned int getFMNetworkSampleRate() const; - std::string getFMNetworkSquelchFile() const; std::string getFMGatewayAddress() const; unsigned short getFMGatewayPort() const; std::string getFMLocalAddress() const; @@ -694,9 +691,6 @@ private: #if defined(USE_FM) bool m_fmNetworkEnabled; - std::string m_fmNetworkProtocol; - unsigned int m_fmNetworkSampleRate; - std::string m_fmNetworkSquelchFile; std::string m_fmGatewayAddress; unsigned short m_fmGatewayPort; std::string m_fmLocalAddress; diff --git a/FMNetwork.cpp b/FMNetwork.cpp index b10c69b..9d20599 100644 --- a/FMNetwork.cpp +++ b/FMNetwork.cpp @@ -30,56 +30,27 @@ #include #include -const unsigned int MMDVM_SAMPLERATE = 8000U; - const unsigned int BUFFER_LENGTH = 1500U; -CFMNetwork::CFMNetwork(const std::string& callsign, const std::string& protocol, const std::string& localAddress, unsigned short localPort, const std::string& gatewayAddress, unsigned short gatewayPort, unsigned int sampleRate, const std::string& squelchFile, bool debug) : -m_callsign(callsign), -m_protocol(FMNP_USRP), +CFMNetwork::CFMNetwork(const std::string& localAddress, unsigned short localPort, const std::string& gatewayAddress, unsigned short gatewayPort, bool debug) : m_socket(localAddress, localPort), m_addr(), m_addrLen(0U), -m_sampleRate(sampleRate), -m_squelchFile(squelchFile), m_debug(debug), m_enabled(false), m_buffer(2000U, "FM Network"), m_seqNo(0U), -#if defined(HAS_SRC) -m_resampler(NULL), -#endif -m_error(0), -m_fp(NULL) +m_timer(1000U, 5U) { - assert(!callsign.empty()); assert(gatewayPort > 0U); assert(!gatewayAddress.empty()); - assert(sampleRate > 0U); if (CUDPSocket::lookup(gatewayAddress, gatewayPort, m_addr, m_addrLen) != 0) m_addrLen = 0U; - - // Remove any trailing letters in the callsign - size_t pos = callsign.find_first_of(' '); - if (pos != std::string::npos) - m_callsign = callsign.substr(0U, pos); - - if (protocol == "RAW") - m_protocol = FMNP_RAW; - else - m_protocol = FMNP_USRP; - -#if defined(HAS_SRC) - m_resampler = ::src_new(SRC_SINC_FASTEST, 1, &m_error); -#endif } CFMNetwork::~CFMNetwork() { -#if defined(HAS_SRC) - ::src_delete(m_resampler); -#endif } bool CFMNetwork::open() @@ -91,26 +62,13 @@ bool CFMNetwork::open() LogMessage("Opening FM network connection"); - if (m_protocol == FMNP_RAW) { - if (!m_squelchFile.empty()) { - m_fp = ::fopen(m_squelchFile.c_str(), "wb"); - if (m_fp == NULL) { -#if !defined(_WIN32) && !defined(_WIN64) - LogError("Cannot open the squelch file: %s, errno=%d", m_squelchFile.c_str(), errno); -#else - LogError("Cannot open the squelch file: %s, errno=%lu", m_squelchFile.c_str(), ::GetLastError()); -#endif - return false; - } - } - } - - if ((m_protocol == FMNP_RAW) && (m_sampleRate != MMDVM_SAMPLERATE)) { - LogError("The resampler needed for non-native sample rates has not been included"); + bool ret = m_socket.open(m_addr); + if (!ret) return false; - } - return m_socket.open(m_addr); + m_timer.start(); + + return true; } bool CFMNetwork::writeData(const float* data, unsigned int nSamples) @@ -118,72 +76,23 @@ bool CFMNetwork::writeData(const float* data, unsigned int nSamples) assert(data != NULL); assert(nSamples > 0U); - if (m_protocol == FMNP_USRP) - return writeUSRPData(data, nSamples); - else if (m_protocol == FMNP_RAW) - return writeRawData(data, nSamples); - else - return false; -} - -bool CFMNetwork::writeUSRPData(const float* data, unsigned int nSamples) -{ - assert(data != NULL); - assert(nSamples > 0U); - if (m_seqNo == 0U) { - bool ret = writeUSRPStart(); + bool ret = writeStart(); if (!ret) return false; } - unsigned char buffer[500U]; - ::memset(buffer, 0x00U, 500U); + assert(data != nullptr); + assert(nSamples > 0U); + + uint8_t buffer[BUFFER_LENGTH]; + ::memset(buffer, 0x00U, BUFFER_LENGTH); unsigned int length = 0U; - buffer[length++] = 'U'; - buffer[length++] = 'S'; - buffer[length++] = 'R'; - buffer[length++] = 'P'; - - // Sequence number - buffer[length++] = (m_seqNo >> 24) & 0xFFU; - buffer[length++] = (m_seqNo >> 16) & 0xFFU; - buffer[length++] = (m_seqNo >> 8) & 0xFFU; - buffer[length++] = (m_seqNo >> 0) & 0xFFU; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // PTT on - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x01U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Type, 0 for audio - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; + buffer[length++] = 'F'; + buffer[length++] = 'M'; + buffer[length++] = 'D'; for (unsigned int i = 0U; i < nSamples; i++) { short val = short(data[i] * 32767.0F + 0.5F); // Changing audio format from float to S16LE @@ -192,170 +101,66 @@ bool CFMNetwork::writeUSRPData(const float* data, unsigned int nSamples) buffer[length++] = (val >> 8) & 0xFFU; } + m_seqNo++; + if (m_debug) CUtils::dump(1U, "FM Network Data Sent", buffer, length); - m_seqNo++; - return m_socket.write(buffer, length, m_addr, m_addrLen); } -bool CFMNetwork::writeRawData(const float* in, unsigned int nIn) +bool CFMNetwork::writeStart() { - assert(in != NULL); - assert(nIn > 0U); + uint8_t buffer[5U]; - if (m_seqNo == 0U) { - bool ret = writeRawStart(); - if (!ret) - return false; - } - - unsigned char buffer[2000U]; - - unsigned int length = 0U; - -#if defined(HAS_SRC) - if (m_sampleRate != MMDVM_SAMPLERATE) { - unsigned int nOut = (nIn * m_sampleRate) / MMDVM_SAMPLERATE; - - float out[1000U]; - - SRC_DATA data; - data.data_in = in; - data.data_out = out; - data.input_frames = nIn; - data.output_frames = nOut; - data.end_of_input = 0; - data.src_ratio = float(m_sampleRate) / float(MMDVM_SAMPLERATE); - - int ret = ::src_process(m_resampler, &data); - if (ret != 0) { - LogError("Error from the write resampler - %d - %s", ret, ::src_strerror(ret)); - return false; - } - - for (unsigned int i = 0U; i < nOut; i++) { - short val = short(out[i] * 32767.0F + 0.5F); // Changing audio format from float to S16LE - - buffer[length++] = (val >> 0) & 0xFFU; - buffer[length++] = (val >> 8) & 0xFFU; - } - } else { -#endif - for (unsigned int i = 0U; i < nIn; i++) { - short val = short(in[i] * 32767.0F + 0.5F); // Changing audio format from float to S16LE - - buffer[length++] = (val >> 0) & 0xFFU; - buffer[length++] = (val >> 8) & 0xFFU; - } -#if defined(HAS_SRC) - } -#endif + buffer[0U] = 'F'; + buffer[1U] = 'M'; + buffer[2U] = 'S'; if (m_debug) - CUtils::dump(1U, "FM Network Data Sent", buffer, length); + CUtils::dump(1U, "FM Network Data Sent", buffer, 3U); - m_seqNo++; - - return m_socket.write(buffer, length, m_addr, m_addrLen); + return m_socket.write(buffer, 3U, m_addr, m_addrLen); } bool CFMNetwork::writeEnd() { - if (m_protocol == FMNP_USRP) - return writeUSRPEnd(); - else - return writeRawEnd(); -} + uint8_t buffer[5U]; -bool CFMNetwork::writeUSRPEnd() -{ - unsigned char buffer[500U]; - ::memset(buffer, 0x00U, 500U); - - unsigned int length = 0U; - - buffer[length++] = 'U'; - buffer[length++] = 'S'; - buffer[length++] = 'R'; - buffer[length++] = 'P'; - - // Sequence number - buffer[length++] = (m_seqNo >> 24) & 0xFFU; - buffer[length++] = (m_seqNo >> 16) & 0xFFU; - buffer[length++] = (m_seqNo >> 8) & 0xFFU; - buffer[length++] = (m_seqNo >> 0) & 0xFFU; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // PTT off - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Type, 0 for audio - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - length += 320U; + buffer[0U] = 'F'; + buffer[1U] = 'M'; + buffer[2U] = 'E'; m_seqNo = 0U; - if (length > 0U) { - if (m_debug) - CUtils::dump(1U, "FM Network Data Sent", buffer, length); + if (m_debug) + CUtils::dump(1U, "FM Network Data Sent", buffer, 3U); - return m_socket.write(buffer, length, m_addr, m_addrLen); - } else { - return true; - } + return m_socket.write(buffer, 3U, m_addr, m_addrLen); } -bool CFMNetwork::writeRawEnd() +bool CFMNetwork::writePing() { - m_seqNo = 0U; + uint8_t buffer[5U]; - if (m_fp != NULL) { - size_t n = ::fwrite("Z", 1, 1, m_fp); - if (n != 1) { -#if !defined(_WIN32) && !defined(_WIN64) - LogError("Cannot write to the squelch file: %s, errno=%d", m_squelchFile.c_str(), errno); -#else - LogError("Cannot write to the squelch file: %s, errno=%lu", m_squelchFile.c_str(), ::GetLastError()); -#endif - return false; - } + buffer[0U] = 'F'; + buffer[1U] = 'M'; + buffer[2U] = 'P'; - ::fflush(m_fp); - } + if (m_debug) + CUtils::dump(1U, "FM Network Data Sent", buffer, 3U); - return true; + return m_socket.write(buffer, 3U, m_addr, m_addrLen); } void CFMNetwork::clock(unsigned int ms) { + m_timer.clock(ms); + if (m_timer.isRunning() && m_timer.hasExpired()) { + writePing(); + m_timer.start(); + } + unsigned char buffer[BUFFER_LENGTH]; sockaddr_storage addr; @@ -365,43 +170,28 @@ void CFMNetwork::clock(unsigned int ms) return; // Check if the data is for us - if (m_protocol == FMNP_USRP) { - if (!CUDPSocket::match(addr, m_addr, IMT_ADDRESS_AND_PORT)) { - LogMessage("FM packet received from an invalid source"); - return; - } - } else { - if (!CUDPSocket::match(addr, m_addr, IMT_ADDRESS_ONLY)) { - LogMessage("FM packet received from an invalid source"); - return; - } + if (!CUDPSocket::match(addr, m_addr, IMT_ADDRESS_AND_PORT)) { + LogMessage("FM packet received from an invalid source"); + return; } if (!m_enabled) return; + // Invalid packet type? + if (::memcmp(buffer, "FM", 2U) != 0) + return; + + if (::memcmp(buffer, "FMP", 3U) == 0) + return; + if (m_debug) CUtils::dump(1U, "FM Network Data Received", buffer, length); - if (m_protocol == FMNP_USRP) { - // Invalid packet type? - if (::memcmp(buffer, "USRP", 4U) != 0) - return; + if (::memcmp(buffer, "FMD", 3U) != 0) + return; - if (length < 32) - return; - - // The type is a big-endian 4-byte integer - unsigned int type = (buffer[20U] << 24) + - (buffer[21U] << 16) + - (buffer[22U] << 8) + - (buffer[23U] << 0); - - if (type == 0U) - m_buffer.addData(buffer + 32U, length - 32U); - } else if (m_protocol == FMNP_RAW) { - m_buffer.addData(buffer, length); - } + m_buffer.addData(buffer + 3U, length - 3U); } unsigned int CFMNetwork::readData(float* out, unsigned int nOut) @@ -413,53 +203,16 @@ unsigned int CFMNetwork::readData(float* out, unsigned int nOut) if (bytes == 0U) return 0U; -#if defined(HAS_SRC) - if ((m_protocol == FMNP_RAW) && (m_sampleRate != MMDVM_SAMPLERATE)) { - unsigned int nIn = (nOut * m_sampleRate) / MMDVM_SAMPLERATE; + if (bytes < nOut) + nOut = bytes; - if (bytes < nIn) { - nIn = bytes; - nOut = (nIn * MMDVM_SAMPLERATE) / m_sampleRate; - } + unsigned char buffer[BUFFER_LENGTH]; + m_buffer.getData(buffer, nOut * sizeof(unsigned short)); - unsigned char buffer[2000U]; - m_buffer.getData(buffer, nIn * sizeof(unsigned short)); - - float in[1000U]; - - for (unsigned int i = 0U; i < nIn; i++) { - short val = ((buffer[i * 2U + 0U] & 0xFFU) << 0) + ((buffer[i * 2U + 1U] & 0xFFU) << 8); - in[i] = float(val) / 65536.0F; - } - - SRC_DATA data; - data.data_in = in; - data.data_out = out; - data.input_frames = nIn; - data.output_frames = nOut; - data.end_of_input = 0; - data.src_ratio = float(MMDVM_SAMPLERATE) / float(m_sampleRate); - - int ret = ::src_process(m_resampler, &data); - if (ret != 0) { - LogError("Error from the read resampler - %d - %s", ret, ::src_strerror(ret)); - return false; - } - } else { -#endif - if (bytes < nOut) - nOut = bytes; - - unsigned char buffer[1500U]; - m_buffer.getData(buffer, nOut * sizeof(unsigned short)); - - for (unsigned int i = 0U; i < nOut; i++) { - short val = ((buffer[i * 2U + 0U] & 0xFFU) << 0) + ((buffer[i * 2U + 1U] & 0xFFU) << 8); - out[i] = float(val) / 65536.0F; - } -#if defined(HAS_SRC) + for (unsigned int i = 0U; i < nOut; i++) { + short val = ((buffer[i * 2U + 0U] & 0xFFU) << 0) + ((buffer[i * 2U + 1U] & 0xFFU) << 8); + out[i] = float(val) / 65536.0F; } -#endif return nOut; } @@ -473,11 +226,6 @@ void CFMNetwork::close() { m_socket.close(); - if (m_fp != NULL) { - ::fclose(m_fp); - m_fp = NULL; - } - LogMessage("Closing FM network connection"); } @@ -491,121 +239,5 @@ void CFMNetwork::enable(bool enabled) m_enabled = enabled; } -bool CFMNetwork::writeUSRPStart() -{ - unsigned char buffer[500U]; - ::memset(buffer, 0x00U, 500U); - - unsigned int length = 0U; - - buffer[length++] = 'U'; - buffer[length++] = 'S'; - buffer[length++] = 'R'; - buffer[length++] = 'P'; - - // Sequence number - buffer[length++] = (m_seqNo >> 24) & 0xFFU; - buffer[length++] = (m_seqNo >> 16) & 0xFFU; - buffer[length++] = (m_seqNo >> 8) & 0xFFU; - buffer[length++] = (m_seqNo >> 0) & 0xFFU; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // PTT off - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Type, 2 for metadata - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x02U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // TLV TAG for Metadata - buffer[length++] = 0x08U; - - // TLV Length - buffer[length++] = 3U + 4U + 3U + 1U + 1U + m_callsign.size() + 1U; - - // DMR Id - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Rpt Id - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Talk Group - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - buffer[length++] = 0x00U; - - // Time Slot - buffer[length++] = 0x00U; - - // Color Code - buffer[length++] = 0x00U; - - // Callsign - for (std::string::const_iterator it = m_callsign.cbegin(); it != m_callsign.cend(); ++it) - buffer[length++] = *it; - - // End of Metadata - buffer[length++] = 0x00U; - - length = 70U; - - if (length > 0U) { - if (m_debug) - CUtils::dump(1U, "FM Network Data Sent", buffer, length); - - return m_socket.write(buffer, length, m_addr, m_addrLen); - } else { - return true; - } -} - -bool CFMNetwork::writeRawStart() -{ - if (m_fp != NULL) { - size_t n = ::fwrite("O", 1, 1, m_fp); - if (n != 1) { -#if !defined(_WIN32) && !defined(_WIN64) - LogError("Cannot write to the squelch file: %s, errno=%d", m_squelchFile.c_str(), errno); -#else - LogError("Cannot write to the squelch file: %s, errno=%lu", m_squelchFile.c_str(), ::GetLastError()); -#endif - return false; - } - - ::fflush(m_fp); - } - - return true; -} - #endif diff --git a/FMNetwork.h b/FMNetwork.h index e8b264b..645524f 100644 --- a/FMNetwork.h +++ b/FMNetwork.h @@ -22,24 +22,17 @@ #include "RingBuffer.h" #include "UDPSocket.h" #include "Defines.h" +#include "Timer.h" #if defined(USE_FM) -#if defined(HAS_SRC) -#include -#endif - #include #include -enum FM_NETWORK_PROTOCOL { - FMNP_USRP, - FMNP_RAW -}; class CFMNetwork { public: - CFMNetwork(const std::string& callsign, const std::string& protocol, const std::string& localAddress, unsigned short localPort, const std::string& gatewayAddress, unsigned short gatewayPort, unsigned int sampleRate, const std::string& squelchFile, bool debug); + CFMNetwork(const std::string& localAddress, unsigned short localPort, const std::string& gatewayAddress, unsigned short gatewayPort, bool debug); ~CFMNetwork(); bool open(); @@ -59,31 +52,17 @@ public: void clock(unsigned int ms); private: - std::string m_callsign; - FM_NETWORK_PROTOCOL m_protocol; CUDPSocket m_socket; sockaddr_storage m_addr; unsigned int m_addrLen; - unsigned int m_sampleRate; - std::string m_squelchFile; bool m_debug; bool m_enabled; CRingBuffer m_buffer; unsigned int m_seqNo; -#if defined(HAS_SRC) - SRC_STATE* m_resampler; -#endif - int m_error; - FILE* m_fp; + CTimer m_timer; - bool writeUSRPStart(); - bool writeRawStart(); - - bool writeUSRPData(const float* data, unsigned int nSamples); - bool writeRawData(const float* in, unsigned int nIn); - - bool writeUSRPEnd(); - bool writeRawEnd(); + bool writeStart(); + bool writePing(); }; #endif diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 2d445b9..a01a881 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2023 by Jonathan Naylor G4KLX + * Copyright (C) 2015-2024 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2230,10 +2230,6 @@ bool CMMDVMHost::createPOCSAGNetwork() #if defined(USE_FM) bool CMMDVMHost::createFMNetwork() { - std::string callsign = m_conf.getFMCallsign(); - std::string protocol = m_conf.getFMNetworkProtocol(); - unsigned int sampleRate = m_conf.getFMNetworkSampleRate(); - std::string squelchFile = m_conf.getFMNetworkSquelchFile(); std::string gatewayAddress = m_conf.getFMGatewayAddress(); unsigned short gatewayPort = m_conf.getFMGatewayPort(); std::string localAddress = m_conf.getFMLocalAddress(); @@ -2246,11 +2242,6 @@ bool CMMDVMHost::createFMNetwork() bool debug = m_conf.getFMNetworkDebug(); LogInfo("FM Network Parameters"); - LogInfo(" Protocol: %s", protocol.c_str()); - if (protocol == "RAW") { - LogInfo(" Sample Rate: %u", sampleRate); - LogInfo(" Squelch File: %s", squelchFile.empty() ? "(none)" : squelchFile.c_str()); - } LogInfo(" Gateway Address: %s", gatewayAddress.c_str()); LogInfo(" Gateway Port: %hu", gatewayPort); LogInfo(" Local Address: %s", localAddress.c_str()); @@ -2261,7 +2252,7 @@ bool CMMDVMHost::createFMNetwork() LogInfo(" RX Audio Gain: %.2f", rxAudioGain); LogInfo(" Mode Hang: %us", m_fmNetModeHang); - m_fmNetwork = new CFMNetwork(callsign, protocol, localAddress, localPort, gatewayAddress, gatewayPort, sampleRate, squelchFile, debug); + m_fmNetwork = new CFMNetwork(localAddress, localPort, gatewayAddress, gatewayPort, debug); bool ret = m_fmNetwork->open(); if (!ret) { diff --git a/Makefile b/Makefile index 6dbcba9..e34f177 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ # This makefile is for all platforms. -# If you have the resampler library installed, add -DHAS_SRC to the CFLAGS line, and -lsamplerate to the LIBS line. - CC = cc CXX = c++ CFLAGS = -g -O3 -Wall -std=c++0x -pthread -I/usr/local/include