make slot numerical;

r05a04_dev
Bryan Biedenkapp 3 weeks ago
parent 4bc3376faa
commit 4f3ac3214e

@ -766,18 +766,16 @@ UInt8Array BaseNetwork::readP25P2(bool& ret, uint32_t& frameLength)
/* Writes P25 Phase 2 frame data to the network. */ /* Writes P25 Phase 2 frame data to the network. */
bool BaseNetwork::writeP25P2(const p25::lc::LC& control, p25::defines::P2_DUID::E duid, bool slot, const uint8_t* data, bool BaseNetwork::writeP25P2(const p25::lc::LC& control, p25::defines::P2_DUID::E duid, uint8_t slot, const uint8_t* data,
const uint8_t controlByte) const uint8_t controlByte)
{ {
if (m_status != NET_STAT_RUNNING && m_status != NET_STAT_MST_RUNNING) if (m_status != NET_STAT_RUNNING && m_status != NET_STAT_MST_RUNNING)
return false; return false;
uint8_t slotNo = slot ? 0x00U : 0x01U;
bool resetSeq = false; bool resetSeq = false;
if (m_p25P2StreamId[slotNo] = 0U) { if (m_p25P2StreamId[slot] = 0U) {
resetSeq = true; resetSeq = true;
m_p25P2StreamId[slotNo] = createStreamId(); m_p25P2StreamId[slot] = createStreamId();
} }
uint32_t messageLength = 0U; uint32_t messageLength = 0U;
@ -786,7 +784,7 @@ bool BaseNetwork::writeP25P2(const p25::lc::LC& control, p25::defines::P2_DUID::
return false; return false;
} }
return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25_P2 }, message.get(), messageLength, pktSeq(resetSeq), m_p25P2StreamId[slotNo]); return writeMaster({ NET_FUNC::PROTOCOL, NET_SUBFUNC::PROTOCOL_SUBFUNC_P25_P2 }, message.get(), messageLength, pktSeq(resetSeq), m_p25P2StreamId[slot]);
} }
/* Helper to test if the P25 ring buffer has data. */ /* Helper to test if the P25 ring buffer has data. */

@ -861,12 +861,12 @@ namespace network
* @brief Writes P25 Phase 2 frame data to the network. * @brief Writes P25 Phase 2 frame data to the network.
* @param[in] control Instance of p25::lc::LC containing link control data. * @param[in] control Instance of p25::lc::LC containing link control data.
* @param[in] duid P25 Phase 2 DUID type. * @param[in] duid P25 Phase 2 DUID type.
* @param[in] slot DMR slot number. * @param[in] slot P25 Phase 2 slot number.
* @param[in] data Buffer containing P25 Phase 2 data to send. * @param[in] data Buffer containing P25 Phase 2 data to send.
* @param[in] controlByte DVM control byte. * @param[in] controlByte DVM control byte.
* @returns bool True, if message was sent, otherwise false. * @returns bool True, if message was sent, otherwise false.
*/ */
virtual bool writeP25P2(const p25::lc::LC& control, p25::defines::P2_DUID::E duid, bool slot, const uint8_t* data, virtual bool writeP25P2(const p25::lc::LC& control, p25::defines::P2_DUID::E duid, uint8_t slot, const uint8_t* data,
const uint8_t controlByte = 0U); const uint8_t controlByte = 0U);
/** /**

Loading…
Cancel
Save

Powered by TurnKey Linux.