mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 14:15:37 +08:00
This adds the ability to override the UID checking in P25 code to force 7 digit IDs.
Jonathan added this code due to a lack of CRC on P25 checking but some parties desire the ability to have any id. It's understood that on networked connections, the need to use a 7 digit unique ID like the DMR ID is necessary. This change is affected by adding a new parameter to the [P25 Network] section called OverrideUIDCheck and it defaults to 0. The logic is, if the network is enabled, or if the network is disabled and the override is disabled, the check is made, otherwise it is not. This has been field tested for all 4 configuration cases and found to work as described above.
This commit is contained in:
@@ -35,8 +35,9 @@ const unsigned char BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U
|
||||
#define WRITE_BIT(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
|
||||
#define READ_BIT(p,i) (p[(i)>>3] & BIT_MASK_TABLE[(i)&7])
|
||||
|
||||
CP25Control::CP25Control(unsigned int nac, CP25Network* network, CDisplay* display, unsigned int timeout, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper) :
|
||||
CP25Control::CP25Control(unsigned int nac, bool uidoverride, CP25Network* network, CDisplay* display, unsigned int timeout, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssiMapper) :
|
||||
m_nac(nac),
|
||||
m_uidoverride(uidoverride),
|
||||
m_network(network),
|
||||
m_display(display),
|
||||
m_duplex(duplex),
|
||||
@@ -176,7 +177,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
|
||||
if (duid == P25_DUID_LDU1) {
|
||||
if (m_rfState == RS_RF_LISTENING) {
|
||||
m_rfData.reset();
|
||||
bool ret = m_rfData.decodeLDU1(data + 2U);
|
||||
bool ret = m_rfData.decodeLDU1(data + 2U, m_network, m_uidoverride);
|
||||
if (!ret) {
|
||||
m_lastDUID = duid;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user