/** * Digital Voice Modem - Host Software * GPLv2 Open Source. Use is subject to license terms. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * @package DVM / Host Software * */ // // Based on code from the MMDVMHost project. (https://github.com/g4klx/MMDVMHost) // Licensed under the GPLv2 License (https://opensource.org/licenses/GPL-2.0) // /* * Copyright (C) 2011-2017 by Jonathan Naylor G4KLX * Copyright (C) 2017-2020 by Bryan Biedenkapp N2PLL * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(__NULL_MODEM_H__) #define __NULL_MODEM_H__ #include "Defines.h" #include "modem/Modem.h" namespace modem { // --------------------------------------------------------------------------- // Class Declaration // Implements the interface to a null modem. // --------------------------------------------------------------------------- class HOST_SW_API NullModem : public Modem { public: /// Initializes a new instance of the NullModem class. NullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, bool dcBlocker, bool cosLockout, uint8_t fdmaPreamble, uint8_t dmrRxDelay, uint8_t packetPlayoutTime, bool disableOFlowReset, bool trace, bool debug); /// Finalizes a instance of the NullModem class. ~NullModem(); /// Sets the modem DSP RF DC offset parameters. virtual void setDCOffsetParams(int txDCOffset, int rxDCOffset) { return; } /// Sets the modem DSP enabled modes. virtual void setModeParams(bool dmrEnabled, bool p25Enabled) { return; } /// Sets the modem DSP RF deviation levels. virtual void setLevels(float rxLevel, float cwIdTXLevel, float dmrTXLevel, float p25TXLevel) { return; } /// Sets the modem DSP Symbol adjustment levels virtual void setSymbolAdjust(int dmrSymLevel3Adj, int dmrSymLevel1Adj, int p25SymLevel3Adj, int p25SymLevel1Adj) { return; } /// Sets the modem DSP DMR color code. virtual void setDMRColorCode(uint32_t colorCode) { return; } /// Sets the modem DSP RF receive deviation levels. virtual void setRXLevel(float rxLevel) { return; } /// Opens connection to the modem DSP. virtual bool open(); /// Updates the timer by the passed number of milliseconds. virtual void clock(uint32_t ms) { return; } /// Closes connection to the modem DSP. virtual void close() { return; } /// Flag indicating whether or not the modem DSP is transmitting. virtual bool hasTX() const { return false; } /// Flag indicating whether or not the modem DSP has carrier detect. virtual bool hasCD() const { return false; } /// Flag indicating whether or not the modem DSP is currently locked out. virtual bool hasLockout() const { return false; } /// Flag indicating whether or not the modem DSP is currently in an error condition. virtual bool hasError() const { return false; } /// Writes DMR Slot 1 frame data to the DMR Slot 1 ring buffer. virtual bool writeDMRData1(const uint8_t* data, uint32_t length) { return true; } /// Writes DMR Slot 2 frame data to the DMR Slot 2 ring buffer. virtual bool writeDMRData2(const uint8_t* data, uint32_t length) { return true; } /// Writes P25 frame data to the P25 ring buffer. virtual bool writeP25Data(const uint8_t* data, uint32_t length) { return true; } /// Triggers the start of DMR transmit. virtual bool writeDMRStart(bool tx) { return true; } /// Writes a DMR short LC to the modem DSP. virtual bool writeDMRShortLC(const uint8_t* lc) { return true; } /// Writes a DMR abort message for the given slot to the modem DSP. virtual bool writeDMRAbort(uint32_t slotNo) { return true; } /// Sets the current operating mode for the modem DSP. virtual bool setMode(DVM_STATE state) { return true; } /// Transmits the given string as CW morse. virtual bool sendCWId(const std::string& callsign) { return true; } }; } // namespace modem #endif // __NULL_MODEM_H__