cleaning up

unstable
Tom Early 4 years ago
parent 245fb5d321
commit ed87b9e7f6

@ -34,7 +34,7 @@ public:
// identity // identity
EProtocol GetProtocol(void) const { return EProtocol::xlx; } EProtocol GetProtocol(void) const { return EProtocol::xlx; }
EProtoRev GetProtocolRevision(void) const { return EProtoRev::m17; } EProtoRev GetProtocolRevision(void) const { return EProtoRev::ambe; }
const char *GetProtocolName(void) const { return "XLX"; } const char *GetProtocolName(void) const { return "XLX"; }
ECodecType GetCodec(void) const { return ECodecType::dmr; } ECodecType GetCodec(void) const { return ECodecType::dmr; }
bool IsPeer(void) const { return true; } bool IsPeer(void) const { return true; }

@ -243,7 +243,7 @@ void CCallsign::SetSuffix(const uint8_t *buffer, int len)
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// modify // modify
void CCallsign::PatchCallsign(int off, const uint8_t *patch, int len) void CCallsign::PatchCallsign(int off, const char *patch, int len)
{ {
if ( off < CALLSIGN_LEN ) if ( off < CALLSIGN_LEN )
{ {

@ -53,7 +53,7 @@ public:
void SetSuffix(const uint8_t *, int); void SetSuffix(const uint8_t *, int);
// modify // modify
void PatchCallsign(int, const uint8_t *, int); void PatchCallsign(int, const char *, int);
// get // get
void GetCallsign(uint8_t *) const; void GetCallsign(uint8_t *) const;

@ -307,7 +307,7 @@ void CDplusProtocol::SendDvHeader(CDvHeaderPacket *packet, CDplusClient *client)
// clone the packet and patch it // clone the packet and patch it
CDvHeaderPacket packet2(*((CDvHeaderPacket *)packet)); CDvHeaderPacket packet2(*((CDvHeaderPacket *)packet));
CCallsign rpt2 = packet2.GetRpt2Callsign(); CCallsign rpt2 = packet2.GetRpt2Callsign();
rpt2.PatchCallsign(0, (const uint8_t *)"XRF", 3); rpt2.PatchCallsign(0, "XRF", 3);
packet2.SetRpt2Callsign(rpt2); packet2.SetRpt2Callsign(rpt2);
// encode it // encode it

@ -43,7 +43,7 @@ bool CG3Protocol::Initialize(const char */*type*/, const EProtocol /*type*/, con
keep_running = true; keep_running = true;
// update the reflector callsign // update the reflector callsign
//m_ReflectorCallsign.PatchCallsign(0, (const uint8_t *)"XLX", 3); //m_ReflectorCallsign.PatchCallsign(0, "XLX", 3);
// create our sockets // create our sockets
CIp ip(AF_INET, G3_DV_PORT, LISTEN_IPV4); CIp ip(AF_INET, G3_DV_PORT, LISTEN_IPV4);

@ -107,7 +107,7 @@ enum class EProtocol { any, none, dextra, dplus, dcs, xlx, urf, dmrplus, dmrmmdv
// URF // URF
#define URF_PORT 10017 // UDP port #define URF_PORT 10017 // UDP port
#define URF_KEEPALIVE_PERIOD 1 // in seconds #define URF_KEEPALIVE_PERIOD 1 // in seconds
#define URF_KEEPALIVE_TIMEOUT (XLX_KEEPALIVE_PERIOD*30) // in seconds #define URF_KEEPALIVE_TIMEOUT (URF_KEEPALIVE_PERIOD*30) // in seconds
#define URF_RECONNECT_PERIOD 5 // in seconds #define URF_RECONNECT_PERIOD 5 // in seconds
// DMRPlus (dongle) // DMRPlus (dongle)

@ -59,7 +59,7 @@ bool CProtocol::Initialize(const char *type, const EProtocol ptype, const uint16
// update the reflector callsign // update the reflector callsign
if (type) if (type)
m_ReflectorCallsign.PatchCallsign(0, (const uint8_t *)type, 3); m_ReflectorCallsign.PatchCallsign(0, type, 3);
// create our sockets // create our sockets
#ifdef LISTEN_IPV4 #ifdef LISTEN_IPV4

@ -18,11 +18,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "Client.h" #include "Client.h"
enum class EURFProtocol { original };
class CURFClient : public CClient class CURFClient : public CClient
{ {
public: public:
@ -35,11 +32,11 @@ public:
virtual ~CURFClient() {}; virtual ~CURFClient() {};
// identity // identity
EProtocol GetProtocol(void) const { return EProtocol::urf; } EProtocol GetProtocol(void) const { return EProtocol::urf; }
EProtoRev GetProtocolRevision(void) const { return m_ProtRev; } EProtoRev GetProtocolRevision(void) const { return m_ProtRev; }
const char *GetProtocolName(void) const { return "URF"; } const char *GetProtocolName(void) const { return "URF"; }
ECodecType GetCodec(void) const { return ECodecType::none; }; ECodecType GetCodec(void) const { return ECodecType::none; }
bool IsPeer(void) const { return true; } bool IsPeer(void) const { return true; }
// status // status
bool IsAlive(void) const; bool IsAlive(void) const;

@ -16,13 +16,13 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "Main.h"
#include <string.h> #include <string.h>
#include "Main.h"
#include "Reflector.h" #include "Reflector.h"
#include "URFPeer.h" #include "URFPeer.h"
#include "URFClient.h" #include "URFClient.h"
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// constructor // constructor

@ -21,13 +21,6 @@
#include "Peer.h" #include "Peer.h"
#include "URFClient.h" #include "URFClient.h"
////////////////////////////////////////////////////////////////////////////////////////
// define
////////////////////////////////////////////////////////////////////////////////////////
// class
class CURFPeer : public CPeer class CURFPeer : public CPeer
{ {
public: public:

@ -18,26 +18,14 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "Client.h" #include "Client.h"
////////////////////////////////////////////////////////////////////////////////////////
// define
#define XLX_PROTOCOL_REVISION_0 0 // AMBE only, original connect mechanism
#define XLX_PROTOCOL_REVISION_1 1 // AMBE only, revised connect mechanism
#define XLX_PROTOCOL_REVISION_2 2 // Transcoded AMBE+AMBE2 interlink
////////////////////////////////////////////////////////////////////////////////////////
// class
class CXlxClient : public CClient class CXlxClient : public CClient
{ {
public: public:
// constructors // constructors
CXlxClient(); CXlxClient();
CXlxClient(const CCallsign &, const CIp &, char = ' ', EProtoRev = EProtoRev::original); CXlxClient(const CCallsign &, const CIp &, char = ' ', EProtoRev = EProtoRev::ambe);
CXlxClient(const CXlxClient &); CXlxClient(const CXlxClient &);
// destructor // destructor

@ -60,15 +60,5 @@ bool CXlxPeer::IsAlive(void) const
EProtoRev CXlxPeer::GetProtocolRevision(const CVersion &version) EProtoRev CXlxPeer::GetProtocolRevision(const CVersion &version)
{ {
EProtoRev protrev = EProtoRev::original; return EProtoRev::ambe;
if ( version.IsEqualOrHigherTo(CVersion(2,2,0)) )
{
protrev = EProtoRev::ambe;
}
else if ( version.IsEqualOrHigherTo(CVersion(1,4,0)) )
{
protrev = EProtoRev::revised;
}
return protrev;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.