Skip to content

Commit

Permalink
fix issue where when *decoding* a EXT_FNCT the src and dst would be i…
Browse files Browse the repository at this point in the history
…nverted resulting in bad logging;
  • Loading branch information
gatekeep committed Jul 16, 2024
1 parent 89f255d commit 4ba65c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/common/p25/lc/tsbk/IOSP_EXT_FNCT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ bool IOSP_EXT_FNCT::decode(const uint8_t* data, bool rawTSBK)
ulong64_t tsbkValue = TSBK::toValue(tsbk);

m_extendedFunction = (uint32_t)((tsbkValue >> 48) & 0xFFFFU); // Extended Function
m_dstId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Argument
m_srcId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Target Radio Address
m_srcId = (uint32_t)((tsbkValue >> 24) & 0xFFFFFFU); // Argument
m_dstId = (uint32_t)(tsbkValue & 0xFFFFFFU); // Target Radio Address

return true;
}
Expand Down
19 changes: 15 additions & 4 deletions src/host/p25/packet/ControlSignaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,18 +483,18 @@ bool ControlSignaling::process(uint8_t* data, uint32_t len, std::unique_ptr<lc::
IOSP_EXT_FNCT* iosp = static_cast<IOSP_EXT_FNCT*>(tsbk.get());
if (m_verbose) {
LogMessage(LOG_RF, P25_TSDU_STR ", %s, op = $%02X, arg = %u, tgt = %u",
tsbk->toString(true).c_str(), iosp->getExtendedFunction(), dstId, srcId);
tsbk->toString(true).c_str(), iosp->getExtendedFunction(), srcId, dstId);
}

// generate activity log entry
if (iosp->getExtendedFunction() == ExtendedFunctions::CHECK_ACK) {
::ActivityLog("P25", true, "radio check response from %u to %u", dstId, srcId);
::ActivityLog("P25", true, "radio check response from %u to %u", srcId, dstId);
}
else if (iosp->getExtendedFunction() == ExtendedFunctions::INHIBIT_ACK) {
::ActivityLog("P25", true, "radio inhibit response from %u to %u", dstId, srcId);
::ActivityLog("P25", true, "radio inhibit response from %u to %u", srcId, dstId);
}
else if (iosp->getExtendedFunction() == ExtendedFunctions::UNINHIBIT_ACK) {
::ActivityLog("P25", true, "radio uninhibit response from %u to %u", dstId, srcId);
::ActivityLog("P25", true, "radio uninhibit response from %u to %u", srcId, dstId);
}

writeRF_TSDU_SBF(iosp, true);
Expand Down Expand Up @@ -911,6 +911,17 @@ bool ControlSignaling::processNetwork(uint8_t* data, uint32_t len, lc::LC& contr
LogMessage(LOG_NET, P25_TSDU_STR ", %s, serviceType = $%02X, arg = %u, tgt = %u",
tsbk->toString(true).c_str(), iosp->getService(), srcId, dstId);
}

// generate activity log entry
if (iosp->getExtendedFunction() == ExtendedFunctions::CHECK_ACK) {
::ActivityLog("P25", false, "radio check response from %u to %u", srcId, dstId);
}
else if (iosp->getExtendedFunction() == ExtendedFunctions::INHIBIT_ACK) {
::ActivityLog("P25", false, "radio inhibit response from %u to %u", srcId, dstId);
}
else if (iosp->getExtendedFunction() == ExtendedFunctions::UNINHIBIT_ACK) {
::ActivityLog("P25", false, "radio uninhibit response from %u to %u", srcId, dstId);
}
}
break;
case TSBKO::ISP_EMERG_ALRM_REQ:
Expand Down

0 comments on commit 4ba65c5

Please sign in to comment.