2016-04-06 18:53:25 +00:00
|
|
|
/*
|
2020-04-11 19:42:05 +00:00
|
|
|
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
|
2016-04-06 18:53:25 +00:00
|
|
|
*
|
|
|
|
* 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(NEXTION_H)
|
|
|
|
#define NEXTION_H
|
|
|
|
|
|
|
|
#include "Display.h"
|
2016-04-11 11:21:46 +00:00
|
|
|
#include "Defines.h"
|
2016-10-06 17:38:16 +00:00
|
|
|
#include "SerialPort.h"
|
2016-06-01 10:55:24 +00:00
|
|
|
#include "Timer.h"
|
2018-09-05 20:12:12 +00:00
|
|
|
#include "Thread.h"
|
2016-04-06 18:53:25 +00:00
|
|
|
#include <string>
|
|
|
|
|
2016-05-09 17:14:27 +00:00
|
|
|
class CNextion : public CDisplay
|
2016-04-06 18:53:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-08-27 09:13:02 +00:00
|
|
|
CNextion(const std::string& callsign, unsigned int dmrid, ISerialPort* serial, unsigned int brightness, bool displayClock, bool utc, unsigned int idleBrightness, unsigned int screenLayout, unsigned int txFrequency, unsigned int rxFrequency, bool displayTempInF);
|
2016-04-06 18:53:25 +00:00
|
|
|
virtual ~CNextion();
|
|
|
|
|
|
|
|
virtual bool open();
|
|
|
|
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void close();
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2016-05-09 17:14:27 +00:00
|
|
|
protected:
|
|
|
|
virtual void setIdleInt();
|
|
|
|
virtual void setErrorInt(const char* text);
|
|
|
|
virtual void setLockoutInt();
|
2018-08-15 16:17:42 +00:00
|
|
|
virtual void setQuitInt();
|
2020-04-11 19:42:05 +00:00
|
|
|
virtual void setFMInt();
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector);
|
2017-01-05 19:44:52 +00:00
|
|
|
virtual void writeDStarRSSIInt(unsigned char rssi);
|
2017-02-12 18:37:00 +00:00
|
|
|
virtual void writeDStarBERInt(float ber);
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void clearDStarInt();
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type);
|
2017-01-05 19:44:52 +00:00
|
|
|
virtual void writeDMRRSSIInt(unsigned int slotNo, unsigned char rssi);
|
2017-11-13 20:48:47 +00:00
|
|
|
virtual void writeDMRTAInt(unsigned int slotNo, unsigned char* talkerAlias, const char* type);
|
2017-12-10 20:50:47 +00:00
|
|
|
|
2017-02-12 18:37:00 +00:00
|
|
|
virtual void writeDMRBERInt(unsigned int slotNo, float ber);
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void clearDMRInt(unsigned int slotNo);
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2020-08-09 14:09:08 +00:00
|
|
|
virtual void writeFusionInt(const char* source, const char* dest, unsigned char dgid, const char* type, const char* origin);
|
2017-01-05 19:44:52 +00:00
|
|
|
virtual void writeFusionRSSIInt(unsigned char rssi);
|
2017-02-12 18:37:00 +00:00
|
|
|
virtual void writeFusionBERInt(float ber);
|
2016-05-09 17:14:27 +00:00
|
|
|
virtual void clearFusionInt();
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2016-09-12 19:23:50 +00:00
|
|
|
virtual void writeP25Int(const char* source, bool group, unsigned int dest, const char* type);
|
2017-01-05 19:44:52 +00:00
|
|
|
virtual void writeP25RSSIInt(unsigned char rssi);
|
2017-02-12 18:37:00 +00:00
|
|
|
virtual void writeP25BERInt(float ber);
|
2016-09-12 17:12:32 +00:00
|
|
|
virtual void clearP25Int();
|
|
|
|
|
2018-01-17 19:04:00 +00:00
|
|
|
virtual void writeNXDNInt(const char* source, bool group, unsigned int dest, const char* type);
|
|
|
|
virtual void writeNXDNRSSIInt(unsigned char rssi);
|
|
|
|
virtual void writeNXDNBERInt(float ber);
|
|
|
|
virtual void clearNXDNInt();
|
|
|
|
|
2020-10-15 13:32:56 +00:00
|
|
|
virtual void writeM17Int(const char* source, const char* dest, const char* type);
|
|
|
|
virtual void writeM17RSSIInt(unsigned char rssi);
|
|
|
|
virtual void writeM17BERInt(float ber);
|
|
|
|
virtual void clearM17Int();
|
|
|
|
|
2018-06-11 20:30:49 +00:00
|
|
|
virtual void writePOCSAGInt(uint32_t ric, const std::string& message);
|
|
|
|
virtual void clearPOCSAGInt();
|
|
|
|
|
2016-09-15 08:58:55 +00:00
|
|
|
virtual void writeCWInt();
|
2016-09-15 13:17:51 +00:00
|
|
|
virtual void clearCWInt();
|
2016-09-15 08:44:21 +00:00
|
|
|
|
2016-06-01 10:55:24 +00:00
|
|
|
virtual void clockInt(unsigned int ms);
|
|
|
|
|
2016-04-06 18:53:25 +00:00
|
|
|
private:
|
2016-10-06 17:38:16 +00:00
|
|
|
std::string m_callsign;
|
2017-11-13 20:48:47 +00:00
|
|
|
std::string m_ipaddress;
|
2016-10-06 17:38:16 +00:00
|
|
|
unsigned int m_dmrid;
|
|
|
|
ISerialPort* m_serial;
|
|
|
|
unsigned int m_brightness;
|
|
|
|
unsigned char m_mode;
|
|
|
|
bool m_displayClock;
|
|
|
|
bool m_utc;
|
|
|
|
unsigned int m_idleBrightness;
|
2017-11-13 20:48:47 +00:00
|
|
|
unsigned int m_screenLayout;
|
2016-10-06 17:38:16 +00:00
|
|
|
CTimer m_clockDisplayTimer;
|
2017-02-12 18:37:00 +00:00
|
|
|
unsigned int m_rssiAccum1;
|
|
|
|
unsigned int m_rssiAccum2;
|
|
|
|
float m_berAccum1;
|
|
|
|
float m_berAccum2;
|
2017-01-05 19:44:52 +00:00
|
|
|
unsigned int m_rssiCount1;
|
|
|
|
unsigned int m_rssiCount2;
|
2017-02-12 18:37:00 +00:00
|
|
|
unsigned int m_berCount1;
|
|
|
|
unsigned int m_berCount2;
|
2018-09-05 20:12:12 +00:00
|
|
|
unsigned int m_txFrequency;
|
|
|
|
unsigned int m_rxFrequency;
|
2020-08-13 19:23:42 +00:00
|
|
|
double m_fl_txFrequency;
|
|
|
|
double m_fl_rxFrequency;
|
2018-09-05 20:12:12 +00:00
|
|
|
bool m_displayTempInF;
|
|
|
|
|
2016-04-06 18:53:25 +00:00
|
|
|
void sendCommand(const char* command);
|
2017-12-28 09:01:52 +00:00
|
|
|
void sendCommandAction(unsigned int status);
|
2016-04-06 18:53:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|