Small cleanup of the RSSI code.
This commit is contained in:
parent
8c0f05c04b
commit
15dd390fb5
1 changed files with 5 additions and 1 deletions
|
@ -123,9 +123,13 @@ void CDMRSlot::writeModem(unsigned char *data, unsigned int len)
|
||||||
uint16_t raw = 0U;
|
uint16_t raw = 0U;
|
||||||
raw |= (data[35U] << 8) & 0xFF00U;
|
raw |= (data[35U] << 8) & 0xFF00U;
|
||||||
raw |= (data[36U] << 0) & 0x00FFU;
|
raw |= (data[36U] << 0) & 0x00FFU;
|
||||||
|
|
||||||
|
// Convert the raw RSSI to dBm
|
||||||
int rssi = m_rssiMapper->interpolate(raw);
|
int rssi = m_rssiMapper->interpolate(raw);
|
||||||
|
LogDebug("DMR Slot %u, raw RSSI: %u, reported RSSI: %d dBm", m_slotNo, raw, rssi);
|
||||||
|
|
||||||
|
// RSSI is always reported as positive
|
||||||
m_rssi = (rssi >= 0) ? rssi : -rssi;
|
m_rssi = (rssi >= 0) ? rssi : -rssi;
|
||||||
LogDebug("DMR Slot %u, raw RSSI: %u, reported RSSI: -%u dBm", m_slotNo, raw, m_rssi);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool dataSync = (data[1U] & DMR_SYNC_DATA) == DMR_SYNC_DATA;
|
bool dataSync = (data[1U] & DMR_SYNC_DATA) == DMR_SYNC_DATA;
|
||||||
|
|
Loading…
Reference in a new issue