|
|
|
|
@ -55,23 +55,19 @@ const uint32_t MAX_NID_ERRS = 7U;//5U;
|
|
|
|
|
NID::NID(uint32_t nac) :
|
|
|
|
|
m_duid(0U),
|
|
|
|
|
m_nac(nac),
|
|
|
|
|
m_rxHdu(NULL),
|
|
|
|
|
m_rxTdu(NULL),
|
|
|
|
|
m_rxLdu1(NULL),
|
|
|
|
|
m_rxPdu(NULL),
|
|
|
|
|
m_rxTsdu(NULL),
|
|
|
|
|
m_rxLdu2(NULL),
|
|
|
|
|
m_rxTdulc(NULL),
|
|
|
|
|
m_splitNac(false),
|
|
|
|
|
m_txHdu(NULL),
|
|
|
|
|
m_txTdu(NULL),
|
|
|
|
|
m_txLdu1(NULL),
|
|
|
|
|
m_txPdu(NULL),
|
|
|
|
|
m_txTsdu(NULL),
|
|
|
|
|
m_txLdu2(NULL),
|
|
|
|
|
m_txTdulc(NULL)
|
|
|
|
|
m_rxTx(NULL),
|
|
|
|
|
m_tx(NULL),
|
|
|
|
|
m_splitNac(false)
|
|
|
|
|
{
|
|
|
|
|
createRxNID(nac);
|
|
|
|
|
m_rxTx = new uint8_t*[16U];
|
|
|
|
|
for (uint8_t i = 0; i < 16U; i++)
|
|
|
|
|
m_rxTx[i] = NULL;
|
|
|
|
|
|
|
|
|
|
m_tx = new uint8_t*[16U];
|
|
|
|
|
for (uint8_t i = 0; i < 16U; i++)
|
|
|
|
|
m_tx[i] = NULL;
|
|
|
|
|
|
|
|
|
|
createRxTxNID(nac);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -79,23 +75,19 @@ NID::NID(uint32_t nac) :
|
|
|
|
|
/// </summary>
|
|
|
|
|
NID::~NID()
|
|
|
|
|
{
|
|
|
|
|
delete[] m_rxHdu;
|
|
|
|
|
delete[] m_rxTdu;
|
|
|
|
|
delete[] m_rxLdu1;
|
|
|
|
|
delete[] m_rxPdu;
|
|
|
|
|
delete[] m_rxTsdu;
|
|
|
|
|
delete[] m_rxLdu2;
|
|
|
|
|
delete[] m_rxTdulc;
|
|
|
|
|
for (uint8_t i = 0; i < 16U; i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_rxTx[i] != NULL) {
|
|
|
|
|
delete[] m_rxTx[i];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_splitNac) {
|
|
|
|
|
delete[] m_txHdu;
|
|
|
|
|
delete[] m_txTdu;
|
|
|
|
|
delete[] m_txLdu1;
|
|
|
|
|
delete[] m_txPdu;
|
|
|
|
|
delete[] m_txTsdu;
|
|
|
|
|
delete[] m_txLdu2;
|
|
|
|
|
delete[] m_txTdulc;
|
|
|
|
|
if (m_tx[i] != NULL) {
|
|
|
|
|
delete[] m_tx[i];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete[] m_rxTx;
|
|
|
|
|
delete[] m_tx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -110,45 +102,45 @@ bool NID::decode(const uint8_t* data)
|
|
|
|
|
uint8_t nid[P25_NID_LENGTH_BYTES];
|
|
|
|
|
P25Utils::decode(data, nid, 48U, 114U);
|
|
|
|
|
|
|
|
|
|
uint32_t errs = P25Utils::compare(nid, m_rxLdu1, P25_NID_LENGTH_BYTES);
|
|
|
|
|
uint32_t errs = P25Utils::compare(nid, m_rxTx[P25_DUID_LDU1], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_LDU1;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxLdu2, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_LDU2], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_LDU2;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTdu, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_PDU], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_TDU;
|
|
|
|
|
m_duid = P25_DUID_PDU;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTdulc, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_TSDU], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_TDULC;
|
|
|
|
|
m_duid = P25_DUID_TSDU;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxPdu, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_HDU], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_PDU;
|
|
|
|
|
m_duid = P25_DUID_HDU;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTsdu, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_TDULC], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_TSDU;
|
|
|
|
|
m_duid = P25_DUID_TDULC;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxHdu, P25_NID_LENGTH_BYTES);
|
|
|
|
|
errs = P25Utils::compare(nid, m_rxTx[P25_DUID_TDU], P25_NID_LENGTH_BYTES);
|
|
|
|
|
if (errs < MAX_NID_ERRS) {
|
|
|
|
|
m_duid = P25_DUID_HDU;
|
|
|
|
|
m_duid = P25_DUID_TDU;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -167,25 +159,13 @@ void NID::encode(uint8_t* data, uint8_t duid) const
|
|
|
|
|
if (m_splitNac) {
|
|
|
|
|
switch (duid) {
|
|
|
|
|
case P25_DUID_HDU:
|
|
|
|
|
P25Utils::encode(m_txHdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TDU:
|
|
|
|
|
P25Utils::encode(m_txTdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_LDU1:
|
|
|
|
|
P25Utils::encode(m_txLdu1, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_PDU:
|
|
|
|
|
P25Utils::encode(m_txPdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TSDU:
|
|
|
|
|
P25Utils::encode(m_txTsdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_LDU2:
|
|
|
|
|
P25Utils::encode(m_txLdu2, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TDULC:
|
|
|
|
|
P25Utils::encode(m_txTdulc, data, 48U, 114U);
|
|
|
|
|
P25Utils::encode(m_tx[duid], data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
@ -194,25 +174,13 @@ void NID::encode(uint8_t* data, uint8_t duid) const
|
|
|
|
|
else {
|
|
|
|
|
switch (duid) {
|
|
|
|
|
case P25_DUID_HDU:
|
|
|
|
|
P25Utils::encode(m_rxHdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TDU:
|
|
|
|
|
P25Utils::encode(m_rxTdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_LDU1:
|
|
|
|
|
P25Utils::encode(m_rxLdu1, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_PDU:
|
|
|
|
|
P25Utils::encode(m_rxPdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TSDU:
|
|
|
|
|
P25Utils::encode(m_rxTsdu, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_LDU2:
|
|
|
|
|
P25Utils::encode(m_rxLdu2, data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
case P25_DUID_TDULC:
|
|
|
|
|
P25Utils::encode(m_rxTdulc, data, 48U, 114U);
|
|
|
|
|
P25Utils::encode(m_rxTx[duid], data, 48U, 114U);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
@ -241,58 +209,58 @@ void NID::setTxNAC(uint32_t nac)
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="nac"></param>
|
|
|
|
|
void NID::createRxNID(uint32_t nac)
|
|
|
|
|
void NID::createRxTxNID(uint32_t nac)
|
|
|
|
|
{
|
|
|
|
|
edac::BCH bch;
|
|
|
|
|
|
|
|
|
|
m_rxHdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxHdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxHdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxHdu[1U] |= P25_DUID_HDU;
|
|
|
|
|
bch.encode(m_rxHdu);
|
|
|
|
|
m_rxHdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTdu[1U] |= P25_DUID_TDU;
|
|
|
|
|
bch.encode(m_rxTdu);
|
|
|
|
|
m_rxTdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxLdu1 = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxLdu1[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxLdu1[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxLdu1[1U] |= P25_DUID_LDU1;
|
|
|
|
|
bch.encode(m_rxLdu1);
|
|
|
|
|
m_rxLdu1[7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxPdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxPdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxPdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxPdu[1U] |= P25_DUID_PDU;
|
|
|
|
|
bch.encode(m_rxPdu);
|
|
|
|
|
m_rxPdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTsdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTsdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTsdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTsdu[1U] |= P25_DUID_TSDU;
|
|
|
|
|
bch.encode(m_rxTsdu);
|
|
|
|
|
m_rxTsdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxLdu2 = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxLdu2[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxLdu2[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxLdu2[1U] |= P25_DUID_LDU2;
|
|
|
|
|
bch.encode(m_rxLdu2);
|
|
|
|
|
m_rxLdu2[7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTdulc = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTdulc[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTdulc[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTdulc[1U] |= P25_DUID_TDULC;
|
|
|
|
|
bch.encode(m_rxTdulc);
|
|
|
|
|
m_rxTdulc[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
m_rxTx[P25_DUID_HDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_HDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_HDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_HDU][1U] |= P25_DUID_HDU;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_HDU]);
|
|
|
|
|
m_rxTx[P25_DUID_HDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_TDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_TDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_TDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_TDU][1U] |= P25_DUID_TDU;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_TDU]);
|
|
|
|
|
m_rxTx[P25_DUID_TDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_LDU1] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_LDU1][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_LDU1][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_LDU1][1U] |= P25_DUID_LDU1;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_LDU1]);
|
|
|
|
|
m_rxTx[P25_DUID_LDU1][7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_PDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_PDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_PDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_PDU][1U] |= P25_DUID_PDU;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_PDU]);
|
|
|
|
|
m_rxTx[P25_DUID_PDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_TSDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_TSDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_TSDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_TSDU][1U] |= P25_DUID_TSDU;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_TSDU]);
|
|
|
|
|
m_rxTx[P25_DUID_TSDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_LDU2] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_LDU2][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_LDU2][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_LDU2][1U] |= P25_DUID_LDU2;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_LDU2]);
|
|
|
|
|
m_rxTx[P25_DUID_LDU2][7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_rxTx[P25_DUID_TDULC] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_rxTx[P25_DUID_TDULC][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_rxTx[P25_DUID_TDULC][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_rxTx[P25_DUID_TDULC][1U] |= P25_DUID_TDULC;
|
|
|
|
|
bch.encode(m_rxTx[P25_DUID_TDULC]);
|
|
|
|
|
m_rxTx[P25_DUID_TDULC][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
@ -303,52 +271,52 @@ void NID::createTxNID(uint32_t nac)
|
|
|
|
|
{
|
|
|
|
|
edac::BCH bch;
|
|
|
|
|
|
|
|
|
|
m_txHdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txHdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txHdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txHdu[1U] |= P25_DUID_HDU;
|
|
|
|
|
bch.encode(m_txHdu);
|
|
|
|
|
m_txHdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_txTdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txTdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txTdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txTdu[1U] |= P25_DUID_TDU;
|
|
|
|
|
bch.encode(m_txTdu);
|
|
|
|
|
m_txTdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_txLdu1 = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txLdu1[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txLdu1[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txLdu1[1U] |= P25_DUID_LDU1;
|
|
|
|
|
bch.encode(m_txLdu1);
|
|
|
|
|
m_txLdu1[7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_txPdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txPdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txPdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txPdu[1U] |= P25_DUID_PDU;
|
|
|
|
|
bch.encode(m_txPdu);
|
|
|
|
|
m_txPdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_txTsdu = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txTsdu[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txTsdu[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txTsdu[1U] |= P25_DUID_TSDU;
|
|
|
|
|
bch.encode(m_txTsdu);
|
|
|
|
|
m_txTsdu[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_txLdu2 = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txLdu2[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txLdu2[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txLdu2[1U] |= P25_DUID_LDU2;
|
|
|
|
|
bch.encode(m_txLdu2);
|
|
|
|
|
m_txLdu2[7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_txTdulc = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_txTdulc[0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_txTdulc[1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_txTdulc[1U] |= P25_DUID_TDULC;
|
|
|
|
|
bch.encode(m_txTdulc);
|
|
|
|
|
m_txTdulc[7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
m_tx[P25_DUID_HDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_HDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_HDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_HDU][1U] |= P25_DUID_HDU;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_HDU]);
|
|
|
|
|
m_tx[P25_DUID_HDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_TDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_TDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_TDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_TDU][1U] |= P25_DUID_TDU;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_TDU]);
|
|
|
|
|
m_tx[P25_DUID_TDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_LDU1] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_LDU1][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_LDU1][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_LDU1][1U] |= P25_DUID_LDU1;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_LDU1]);
|
|
|
|
|
m_tx[P25_DUID_LDU1][7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_PDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_PDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_PDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_PDU][1U] |= P25_DUID_PDU;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_PDU]);
|
|
|
|
|
m_tx[P25_DUID_PDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_TSDU] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_TSDU][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_TSDU][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_TSDU][1U] |= P25_DUID_TSDU;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_TSDU]);
|
|
|
|
|
m_tx[P25_DUID_TSDU][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_LDU2] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_LDU2][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_LDU2][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_LDU2][1U] |= P25_DUID_LDU2;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_LDU2]);
|
|
|
|
|
m_tx[P25_DUID_LDU2][7U] |= 0x01U; // Set the parity bit
|
|
|
|
|
|
|
|
|
|
m_tx[P25_DUID_TDULC] = new uint8_t[P25_NID_LENGTH_BYTES];
|
|
|
|
|
m_tx[P25_DUID_TDULC][0U] = (nac >> 4) & 0xFFU;
|
|
|
|
|
m_tx[P25_DUID_TDULC][1U] = (nac << 4) & 0xF0U;
|
|
|
|
|
m_tx[P25_DUID_TDULC][1U] |= P25_DUID_TDULC;
|
|
|
|
|
bch.encode(m_tx[P25_DUID_TDULC]);
|
|
|
|
|
m_tx[P25_DUID_TDULC][7U] &= 0xFEU; // Clear the parity bit
|
|
|
|
|
}
|
|
|
|
|
|