extend W3AXLs implementation for space in blocks to the air interface modems as well (even though the modem firmware doesn't support it yet), for future proofing purposes;

pull/69/head
Bryan Biedenkapp 1 year ago
parent a5709dd0a7
commit 9a9441fbd5

@ -740,6 +740,9 @@ void Modem::clock(uint32_t ms)
bool p25Enable = (m_buffer[3U] & 0x08U) == 0x08U;
bool nxdnEnable = (m_buffer[3U] & 0x10U) == 0x10U;
// flag indicating if free space is being reported in 16-byte blocks instead of LDUs
bool spaceInBlocks = (m_buffer[3U] & 0x80) == 0x80;
m_modemState = (DVM_STATE)m_buffer[4U];
m_tx = (m_buffer[5U] & 0x01U) == 0x01U;
@ -806,12 +809,19 @@ void Modem::clock(uint32_t ms)
m_cd = (m_buffer[5U] & 0x40U) == 0x40U;
// spaces from the modem are returned in "logical" frame count, not raw byte size
// spaces from the modem are returned in "logical" frame count, or a block size, not raw byte size
// for DMR and NXDN, becuase the protocols use fixed length frames we always return
// space in frame count
m_dmrSpace1 = m_buffer[7U] * (DMRDEF::DMR_FRAME_LENGTH_BYTES + 2U);
m_dmrSpace2 = m_buffer[8U] * (DMRDEF::DMR_FRAME_LENGTH_BYTES + 2U);
m_p25Space = m_buffer[10U] * (P25DEF::P25_LDU_FRAME_LENGTH_BYTES);//(P25DEF::P25_PDU_FRAME_LENGTH_BYTES);
m_nxdnSpace = m_buffer[11U] * (NXDDEF::NXDN_FRAME_LENGTH_BYTES);
// P25 free space can be reported as 16-byte blocks or frames based on the flag above
if (spaceInBlocks)
m_p25Space = m_buffer[10U] * P25_BUFFER_BLOCK_SIZE;
else
m_p25Space = m_buffer[10U] * (P25DEF::P25_LDU_FRAME_LENGTH_BYTES);
if (m_dumpModemStatus) {
LogDebug(LOG_MODEM, "Modem::clock(), CMD_GET_STATUS, isHotspot = %u, dmr = %u / %u, p25 = %u / %u, nxdn = %u / %u, modemState = %u, tx = %u, adcOverflow = %u, rxOverflow = %u, txOverflow = %u, dacOverflow = %u, dmrSpace1 = %u, dmrSpace2 = %u, p25Space = %u, nxdnSpace = %u",
m_isHotspot, dmrEnable, m_dmrEnabled, p25Enable, m_p25Enabled, nxdnEnable, m_nxdnEnabled, m_modemState, m_tx, adcOverflow, rxOverflow, txOverflow, dacOverflow, m_dmrSpace1, m_dmrSpace2, m_p25Space, m_nxdnSpace);

@ -273,7 +273,9 @@ namespace modem
const uint32_t MAX_DAC_OVERFLOW = 128U;
const uint32_t MODEM_POLL_TIME = 125U;
const uint32_t P25_BUFFER_BLOCK_SIZE = 16U;
/** @} */
// ---------------------------------------------------------------------------

@ -216,7 +216,7 @@ void ModemV24::clock(uint32_t ms)
bool p25Enable = (m_buffer[3U] & 0x08U) == 0x08U;
bool nxdnEnable = (m_buffer[3U] & 0x10U) == 0x10U;
// Flag indicating if free space is being reported in 16-byte blocks instead of LDUs
// flag indicating if free space is being reported in 16-byte blocks instead of LDUs
bool spaceInBlocks = (m_buffer[3U] & 0x80) == 0x80;
m_modemState = (DVM_STATE)m_buffer[4U];
@ -285,6 +285,7 @@ void ModemV24::clock(uint32_t ms)
m_cd = (m_buffer[5U] & 0x40U) == 0x40U;
// spaces from the modem are returned in "logical" frame count, or a block size, not raw byte size
// DMR and NXDN space are always 0U since the board doesn't support them
m_dmrSpace1 = 0U;
m_dmrSpace2 = 0U;
@ -292,13 +293,9 @@ void ModemV24::clock(uint32_t ms)
// P25 free space can be reported as 16-byte blocks or frames based on the flag above
if (spaceInBlocks)
{
m_p25Space = m_buffer[10U] * 16U;
}
m_p25Space = m_buffer[10U] * P25_BUFFER_BLOCK_SIZE;
else
{
m_p25Space = m_buffer[10U] * (P25DEF::P25_LDU_FRAME_LENGTH_BYTES);
}
if (m_dumpModemStatus) {
LogDebug(LOG_MODEM, "ModemV24::clock(), CMD_GET_STATUS, isHotspot = %u, dmr = %u / %u, p25 = %u / %u, nxdn = %u / %u, modemState = %u, tx = %u, adcOverflow = %u, rxOverflow = %u, txOverflow = %u, dacOverflow = %u, dmrSpace1 = %u, dmrSpace2 = %u, p25Space = %u, nxdnSpace = %u",

Loading…
Cancel
Save

Powered by TurnKey Linux.