-
Notifications
You must be signed in to change notification settings - Fork 7
/
NullModem.h
78 lines (57 loc) · 3.31 KB
/
NullModem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* Copyright (C) 2011-2018,2020 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
* 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.
*/
#pragma once
#include "Modem.h"
#include "Defines.h"
#include <string>
class CNullModem : public CModem {
public:
CNullModem(const std::string& port, bool duplex, bool rxInvert, bool txInvert, bool pttInvert, unsigned int txDelay, unsigned int dmrDelay, bool trace, bool debug);
virtual ~CNullModem();
virtual void setSerialParams(const std::string& protocol, unsigned int address) override {};
virtual void setRFParams(unsigned int rxFrequency, int rxOffset, unsigned int txFrequency, int txOffset, int txDCOffset, int rxDCOffset, float rfLevel, unsigned int pocsagFrequency) override {};
virtual void setModeParams(bool dmrEnabled, bool pocsagEnabled, bool fmEnabled) {};
virtual void setLevels(float rxLevel, float cwIdTXLevel, float dmrTXLevel, float pocsagLevel, float fmTXLevel) {};
virtual void setDMRParams(unsigned int colorCode) override {};
virtual void setTransparentDataParams(unsigned int sendFrameType) override {};
virtual bool open() override;
virtual bool hasDMR() const override {return true;};
virtual bool hasPOCSAG() const override {return true;};
virtual unsigned int readDMRData1(unsigned char* data) override {return 0;};
virtual unsigned int readDMRData2(unsigned char* data) override {return 0;};
virtual unsigned int readTransparentData(unsigned char* data) override {return 0;};
virtual bool hasDMRSpace1() const override {return true;};
virtual bool hasDMRSpace2() const override {return true;};
virtual bool hasPOCSAGSpace() const override {return true;};
virtual bool hasTX() const override {return false;};
virtual bool hasError() const override {return false;};
virtual bool writeDMRData1(const unsigned char* data, unsigned int length) override {return true;};
virtual bool writeDMRData2(const unsigned char* data, unsigned int length) override {return true;};
virtual bool writePOCSAGData(const unsigned char* data, unsigned int length) override {return true;};
virtual bool writeTransparentData(const unsigned char* data, unsigned int length) override {return true;};
virtual bool writeDMRStart(bool tx) override {return true;};
virtual bool writeDMRShortLC(const unsigned char* lc) override {return true;};
virtual bool writeDMRAbort(unsigned int slotNo) override {return true;};
virtual bool setMode(unsigned char mode) override {return true;};
virtual bool sendCWId(const std::string& callsign) override {return true;};
virtual const char* getHWType() const override {return m_hwType;};
virtual void clock(unsigned int ms) override {};
virtual void close() override {};
private:
const char* m_hwType;
};