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

Merge pull request #49 from yngwiechou/devel_module_id

Make DMRmmdvm and DMRplus repeater module ID configurable
This commit is contained in:
LX3JL 2017-11-06 18:37:21 +01:00 committed by GitHub
commit f15264aedc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
}
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
}
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
}
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
}
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]));
callsign->SetDmrid(uiRptrId, true);
callsign->SetModule('B');
callsign->SetModule(MMDVM_MODULE_ID);
valid = callsign->IsValid();
}
return valid;
@ -673,7 +673,7 @@ bool CDmrmmdvmProtocol::IsValidDvHeaderPacket(const CBuffer &Buffer, CDvHeaderPa
// build DVHeader
CCallsign csMY = CCallsign("", uiSrcId);
CCallsign rpt1 = CCallsign("", uiRptrId);
rpt1.SetModule('B');
rpt1.SetModule(MMDVM_MODULE_ID);
CCallsign rpt2 = m_ReflectorCallsign;
rpt2.SetModule(DmrDstIdToModule(uiDstId));

View File

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

View File

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

View File

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