cleaning up

unstable
Tom Early 4 years ago
parent 245fb5d321
commit ed87b9e7f6

@ -34,7 +34,7 @@ public:
// identity
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"; }
ECodecType GetCodec(void) const { return ECodecType::dmr; }
bool IsPeer(void) const { return true; }

@ -243,7 +243,7 @@ void CCallsign::SetSuffix(const uint8_t *buffer, int len)
////////////////////////////////////////////////////////////////////////////////////////
// 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 )
{

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

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

@ -43,7 +43,7 @@ bool CG3Protocol::Initialize(const char */*type*/, const EProtocol /*type*/, con
keep_running = true;
// update the reflector callsign
//m_ReflectorCallsign.PatchCallsign(0, (const uint8_t *)"XLX", 3);
//m_ReflectorCallsign.PatchCallsign(0, "XLX", 3);
// create our sockets
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
#define URF_PORT 10017 // UDP port
#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
// DMRPlus (dongle)

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

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

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

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

@ -18,26 +18,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#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
{
public:
// constructors
CXlxClient();
CXlxClient(const CCallsign &, const CIp &, char = ' ', EProtoRev = EProtoRev::original);
CXlxClient(const CCallsign &, const CIp &, char = ' ', EProtoRev = EProtoRev::ambe);
CXlxClient(const CXlxClient &);
// destructor

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

Loading…
Cancel
Save

Powered by TurnKey Linux.