correct issue with direct literal assignment to the JSON structure (you cannot do this); correct LC_TEL_INT_VCH_USER reading data from an incorrect offset; correct a bad testcase assumption;

pull/134/head
Bryan Biedenkapp 2 weeks ago
parent c0f4b89f6e
commit ffaf2ff88b

@ -44,9 +44,9 @@ bool LC_TEL_INT_VCH_USER::decode(const uint8_t* data)
ulong64_t rsValue = TDULC::toValue(rs);
m_group = false;
m_emergency = (rs[2U] & 0x80U) == 0x80U; // Emergency Flag
m_encrypted = (rs[2U] & 0x40U) == 0x40U; // Encryption Flag
m_priority = (rs[2U] & 0x07U); // Priority
m_emergency = (rs[1U] & 0x80U) == 0x80U; // Emergency Flag
m_encrypted = (rs[1U] & 0x40U) == 0x40U; // Encryption Flag
m_priority = (rs[1U] & 0x07U); // Priority
m_callTimer = (uint32_t)((rsValue >> 24) & 0xFFFFU); // Call Timer
// the single address is the subscriber unit in the call, which also identifies the call
m_dstId = (uint32_t)(rsValue & 0xFFFFFFU); // Source/Target Address

@ -2601,7 +2601,7 @@ bool ControlSignaling::writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_
json::object req = json::object();
req["dstId"].set<uint32_t>(dstId);
if (telInt) {
req["telInt"].set<bool>(true);
req["telInt"].set<bool>(telInt);
}
// send blocking RPC request

@ -328,8 +328,8 @@ namespace p25
* @param telInt Flag indicating this grant is for a telephone interconnect call to the unit in dstId.
* @returns True, if granted, otherwise false.
*/
bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false, bool skip = false, uint32_t chNo = 0U,
bool telInt = false);
bool writeRF_TSDU_Grant(uint32_t srcId, uint32_t dstId, uint8_t serviceOptions, bool grp, bool net = false,
bool skip = false, uint32_t chNo = 0U, bool telInt = false);
/**
* @brief Helper to write a grant update packet.
*/

@ -108,7 +108,7 @@ TEST_CASE("TSBK Telephone Interconnect", "[p25][tsbk]") {
isp.encode(raw, true, true);
REQUIRE((raw[0U] & 0x3FU) == TSBKO::ISP_TELE_INT_PSTN_REQ);
REQUIRE(raw[2U] == 0x80U); // Service Options
REQUIRE(raw[2U] == 0x84U); // Service Options
REQUIRE(raw[3U] == 0x00U); // Reserved
REQUIRE(raw[4U] == 0x00U);
REQUIRE(raw[5U] == 0x00U);
@ -123,6 +123,7 @@ TEST_CASE("TSBK Telephone Interconnect", "[p25][tsbk]") {
ISP_TELE_INT_PSTN_REQ* decoded = dynamic_cast<ISP_TELE_INT_PSTN_REQ*>(tsbk.get());
REQUIRE(decoded != nullptr);
REQUIRE(decoded->getEmergency() == true);
REQUIRE(decoded->getPriority() == 4U);
REQUIRE(decoded->getPSTNAddress() == 0x07U);
REQUIRE(decoded->getSrcId() == 0x00ABCDU);
}

Loading…
Cancel
Save

Powered by TurnKey Linux.