1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2024-11-16 13:11:45 -05:00

Make DMRmmdvm and DMRplus node module Id configurable

This commit is contained in:
Yngwie Chou 2017-08-29 07:16:01 +08:00
parent e7b9123409
commit c909cfbea8
4 changed files with 16 additions and 10 deletions

View File

@ -511,7 +511,7 @@ bool CDmrmmdvmProtocol::IsValidKeepAlivePacket(const CBuffer &Buffer, CCallsign
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[10],Buffer.data()[9]),MAKEWORD(Buffer.data()[8],Buffer.data()[7])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[10],Buffer.data()[9]),MAKEWORD(Buffer.data()[8],Buffer.data()[7]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
} }
return valid; return valid;
@ -526,7 +526,7 @@ bool CDmrmmdvmProtocol::IsValidConnectPacket(const CBuffer &Buffer, CCallsign *c
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
if ( !valid) if ( !valid)
{ {
@ -545,7 +545,7 @@ bool CDmrmmdvmProtocol::IsValidAuthenticationPacket(const CBuffer &Buffer, CCall
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
} }
return valid; return valid;
@ -560,7 +560,7 @@ bool CDmrmmdvmProtocol::IsValidDisconnectPacket(const CBuffer &Buffer, CCallsign
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
} }
return valid; return valid;
@ -575,7 +575,7 @@ bool CDmrmmdvmProtocol::IsValidConfigPacket(const CBuffer &Buffer, CCallsign *ca
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
} }
return valid; return valid;
@ -590,7 +590,7 @@ bool CDmrmmdvmProtocol::IsValidOptionPacket(const CBuffer &Buffer, CCallsign *ca
{ {
uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4])); uint32 uiRptrId = MAKEDWORD(MAKEWORD(Buffer.data()[7],Buffer.data()[6]),MAKEWORD(Buffer.data()[5],Buffer.data()[4]));
callsign->SetDmrid(uiRptrId, true); callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B'); callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid(); valid = callsign->IsValid();
} }
return valid; return valid;
@ -673,7 +673,7 @@ bool CDmrmmdvmProtocol::IsValidDvHeaderPacket(const CBuffer &Buffer, CDvHeaderPa
// build DVHeader // build DVHeader
CCallsign csMY = CCallsign("", uiSrcId); CCallsign csMY = CCallsign("", uiSrcId);
CCallsign rpt1 = CCallsign("", uiRptrId); CCallsign rpt1 = CCallsign("", uiRptrId);
rpt1.SetModule('B'); rpt1.SetModule(MMDVM_MODULE_ID);
CCallsign rpt2 = m_ReflectorCallsign; CCallsign rpt2 = m_ReflectorCallsign;
rpt2.SetModule(DmrDstIdToModule(uiDstId)); rpt2.SetModule(DmrDstIdToModule(uiDstId));

View File

@ -43,6 +43,9 @@
#define MMDVM_SLOTTYPE_HEADER 1 #define MMDVM_SLOTTYPE_HEADER 1
#define MMDVM_SLOTTYPE_TERMINATOR 2 #define MMDVM_SLOTTYPE_TERMINATOR 2
// DMRMMDVM Module ID
#define MMDVM_MODULE_ID "B"
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// class // class

View File

@ -414,7 +414,7 @@ bool CDmrplusProtocol::IsValidConnectPacket(const CBuffer &Buffer, CCallsign *ca
sz[8] = 0; sz[8] = 0;
uint32 dmrid = atoi(sz); uint32 dmrid = atoi(sz);
callsign->SetDmrid(dmrid, true); callsign->SetDmrid(dmrid, true);
callsign->SetModule('B'); callsign->SetModule(DMRPLUS_MODULE_ID);
::memcpy(sz, &Buffer.data()[8], 4); ::memcpy(sz, &Buffer.data()[8], 4);
sz[4] = 0; sz[4] = 0;
*reflectormodule = DmrDstIdToModule(atoi(sz)); *reflectormodule = DmrDstIdToModule(atoi(sz));
@ -437,7 +437,7 @@ bool CDmrplusProtocol::IsValidDisconnectPacket(const CBuffer &Buffer, CCallsign
sz[8] = 0; sz[8] = 0;
uint32 dmrid = atoi(sz); uint32 dmrid = atoi(sz);
callsign->SetDmrid(dmrid, true); callsign->SetDmrid(dmrid, true);
callsign->SetModule('B'); callsign->SetModule(DMRPLUS_MODULE_ID);
*reflectormodule = Buffer.data()[11] - '0' + 'A'; *reflectormodule = Buffer.data()[11] - '0' + 'A';
valid = (callsign->IsValid() && std::isupper(*reflectormodule)); valid = (callsign->IsValid() && std::isupper(*reflectormodule));
} }
@ -467,7 +467,7 @@ bool CDmrplusProtocol::IsValidDvHeaderPacket(const CIp &Ip, const CBuffer &Buffe
// build DVHeader // build DVHeader
CCallsign csMY = CCallsign("", uiSrcId); CCallsign csMY = CCallsign("", uiSrcId);
CCallsign rpt1 = CCallsign("", uiSrcId); CCallsign rpt1 = CCallsign("", uiSrcId);
rpt1.SetModule('B'); rpt1.SetModule(DMRPLUS_MODULE_ID);
CCallsign rpt2 = m_ReflectorCallsign; CCallsign rpt2 = m_ReflectorCallsign;
rpt2.SetModule(DmrDstIdToModule(uiDstId)); rpt2.SetModule(DmrDstIdToModule(uiDstId));
uint32 uiStreamId = IpToStreamId(Ip); uint32 uiStreamId = IpToStreamId(Ip);

View File

@ -34,6 +34,9 @@
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// define // define
// DMR Plus Module ID
#define DMRPLUS_MODULE_ID "B"
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
// class // class