fix issue not pasing dump TSBK boolean; simplify P25 CC data stream generation; fix issue getting status data from modem before displaying calibration help; display hotspot engineering status data; remove p25 correlation count from hotspot;

pull/12/head
Bryan Biedenkapp 4 years ago
parent 945968219a
commit c82bc4d53e

@ -400,8 +400,9 @@ int HostCal::run()
writeConfig(); writeConfig();
displayHelp(); getStatus();
displayHelp();
printStatus(); printStatus();
bool end = false; bool end = false;
@ -517,6 +518,7 @@ int HostCal::run()
case 'w': case 'w':
{ {
if (!m_isHotspot) {
char value[5] = { '\0' }; char value[5] = { '\0' };
::fprintf(stdout, "> P25 Correlation Count [%u] ? ", m_p25CorrCount); ::fprintf(stdout, "> P25 Correlation Count [%u] ? ", m_p25CorrCount);
::fflush(stdout); ::fflush(stdout);
@ -532,6 +534,7 @@ int HostCal::run()
writeConfig(); writeConfig();
} }
} }
}
break; break;
case 'F': case 'F':
@ -1098,10 +1101,12 @@ void HostCal::displayHelp()
} }
LogMessage(LOG_CAL, " N Set FDMA Preambles"); LogMessage(LOG_CAL, " N Set FDMA Preambles");
LogMessage(LOG_CAL, " W Set DMR Rx Delay"); LogMessage(LOG_CAL, " W Set DMR Rx Delay");
if (!m_isHotspot) {
LogMessage(LOG_CAL, " w Set P25 Correlation Count"); LogMessage(LOG_CAL, " w Set P25 Correlation Count");
}
if (m_isHotspot) { if (m_isHotspot) {
LogMessage(LOG_CAL, " F Set Rx Frequency Adjustment (hotspot modems only!)"); LogMessage(LOG_CAL, " F Set Rx Frequency Adjustment");
LogMessage(LOG_CAL, " f Set Tx Frequency Adjustment (hotspot modems only!)"); LogMessage(LOG_CAL, " f Set Tx Frequency Adjustment");
} }
LogMessage(LOG_CAL, "Mode Commands:"); LogMessage(LOG_CAL, "Mode Commands:");
LogMessage(LOG_CAL, " Z %s", DMR_CAL_STR); LogMessage(LOG_CAL, " Z %s", DMR_CAL_STR);
@ -1118,16 +1123,16 @@ void HostCal::displayHelp()
LogMessage(LOG_CAL, " x %s", RSSI_CAL_STR); LogMessage(LOG_CAL, " x %s", RSSI_CAL_STR);
LogMessage(LOG_CAL, "Engineering Commands:"); LogMessage(LOG_CAL, "Engineering Commands:");
if (!m_isHotspot) { if (!m_isHotspot) {
LogMessage(LOG_CAL, " -/= Inc/Dec DMR +/- 3 Symbol Level (dedicated modems only!)"); LogMessage(LOG_CAL, " -/= Inc/Dec DMR +/- 3 Symbol Level");
LogMessage(LOG_CAL, " _/+ Inc/Dec DMR +/- 1 Symbol Level (dedicated modems only!)"); LogMessage(LOG_CAL, " _/+ Inc/Dec DMR +/- 1 Symbol Level");
LogMessage(LOG_CAL, " [/] Inc/Dec P25 +/- 3 Symbol Level (dedicated modems only!)"); LogMessage(LOG_CAL, " [/] Inc/Dec P25 +/- 3 Symbol Level");
LogMessage(LOG_CAL, " {/} Inc/Dec P25 +/- 1 Symbol Level (dedicated modems only!)"); LogMessage(LOG_CAL, " {/} Inc/Dec P25 +/- 1 Symbol Level");
} }
else { else {
LogMessage(LOG_CAL, " 1 Set DMR Disc. Bandwidth Offset (hotspot modems only!)"); LogMessage(LOG_CAL, " 1 Set DMR Disc. Bandwidth Offset");
LogMessage(LOG_CAL, " 2 Set P25 Disc. Bandwidth Offset (hotspot modems only!)"); LogMessage(LOG_CAL, " 2 Set P25 Disc. Bandwidth Offset");
LogMessage(LOG_CAL, " 3 Set DMR Post Demod Bandwidth Offset (hotspot modems only!)"); LogMessage(LOG_CAL, " 3 Set DMR Post Demod Bandwidth Offset");
LogMessage(LOG_CAL, " 4 Set P25 Post Demod Bandwidth Offset (hotspot modems only!)"); LogMessage(LOG_CAL, " 4 Set P25 Post Demod Bandwidth Offset");
} }
} }
@ -2024,6 +2029,26 @@ void HostCal::timerStop()
m_timer = 0U; m_timer = 0U;
} }
/// <summary>
/// Retrieve the current status from the air interface modem.
/// </summary>
void HostCal::getStatus()
{
uint8_t buffer[50U];
buffer[0U] = DVM_FRAME_START;
buffer[1U] = 4U;
buffer[2U] = CMD_GET_STATUS;
int ret = m_modem->write(buffer, 4U);
if (ret <= 0)
return;
sleep(25U);
m_modem->clock(0U);
}
/// <summary> /// <summary>
/// Prints the current status of the calibration. /// Prints the current status of the calibration.
/// </summary> /// </summary>
@ -2046,27 +2071,21 @@ void HostCal::printStatus()
m_pttInvert ? "yes" : "no", m_rxInvert ? "yes" : "no", m_txInvert ? "yes" : "no", m_dcBlocker ? "yes" : "no"); m_pttInvert ? "yes" : "no", m_rxInvert ? "yes" : "no", m_txInvert ? "yes" : "no", m_dcBlocker ? "yes" : "no");
LogMessage(LOG_CAL, " - RX Level: %.1f%%, TX Level: %.1f%%, TX DC Offset: %d, RX DC Offset: %d", LogMessage(LOG_CAL, " - RX Level: %.1f%%, TX Level: %.1f%%, TX DC Offset: %d, RX DC Offset: %d",
m_rxLevel, m_txLevel, m_txDCOffset, m_rxDCOffset); m_rxLevel, m_txLevel, m_txDCOffset, m_rxDCOffset);
if (!m_isHotspot) {
LogMessage(LOG_CAL, " - DMR Symbol +/- 3 Level Adj.: %d, DMR Symbol +/- 1 Level Adj.: %d, P25 Symbol +/- 3 Level Adj.: %d, P25 Symbol +/- 1 Level Adj.: %d", LogMessage(LOG_CAL, " - DMR Symbol +/- 3 Level Adj.: %d, DMR Symbol +/- 1 Level Adj.: %d, P25 Symbol +/- 3 Level Adj.: %d, P25 Symbol +/- 1 Level Adj.: %d",
m_dmrSymLevel3Adj, m_dmrSymLevel1Adj, m_p25SymLevel3Adj, m_p25SymLevel1Adj); m_dmrSymLevel3Adj, m_dmrSymLevel1Adj, m_p25SymLevel3Adj, m_p25SymLevel1Adj);
}
if (m_isHotspot) {
LogMessage(LOG_CAL, " - DMR Disc. BW: %d, P25 Disc. BW: %d, DMR Post Demod BW: %d, P25 Post Demod BW: %d",
m_dmrDiscBWAdj, m_p25DiscBWAdj, m_dmrPostBWAdj, m_p25PostBWAdj);
}
LogMessage(LOG_CAL, " - FDMA Preambles: %u (%.1fms), DMR Rx Delay: %u (%.1fms), P25 Corr. Count: %u (%.1fms)", m_fdmaPreamble, float(m_fdmaPreamble) * 0.2083F, m_dmrRxDelay, float(m_dmrRxDelay) * 0.0416666F, LogMessage(LOG_CAL, " - FDMA Preambles: %u (%.1fms), DMR Rx Delay: %u (%.1fms), P25 Corr. Count: %u (%.1fms)", m_fdmaPreamble, float(m_fdmaPreamble) * 0.2083F, m_dmrRxDelay, float(m_dmrRxDelay) * 0.0416666F,
m_p25CorrCount, float(m_p25CorrCount) * 0.667F); m_p25CorrCount, float(m_p25CorrCount) * 0.667F);
LogMessage(LOG_CAL, " - Rx Freq: %uHz, Tx Freq: %uHz, Rx Offset: %dHz, Tx Offset: %dHz", m_rxFrequency, m_txFrequency, m_rxTuning, m_txTuning); LogMessage(LOG_CAL, " - Rx Freq: %uHz, Tx Freq: %uHz, Rx Offset: %dHz, Tx Offset: %dHz", m_rxFrequency, m_txFrequency, m_rxTuning, m_txTuning);
LogMessage(LOG_CAL, " - Rx Effective Freq: %uHz, Tx Effective Freq: %uHz", m_rxAdjustedFreq, m_txAdjustedFreq); LogMessage(LOG_CAL, " - Rx Effective Freq: %uHz, Tx Effective Freq: %uHz", m_rxAdjustedFreq, m_txAdjustedFreq);
} }
uint8_t buffer[50U]; getStatus();
buffer[0U] = DVM_FRAME_START;
buffer[1U] = 4U;
buffer[2U] = CMD_GET_STATUS;
int ret = m_modem->write(buffer, 4U);
if (ret <= 0)
return;
sleep(25U);
m_modem->clock(0U);
} }
/// <summary> /// <summary>

@ -184,6 +184,8 @@ private:
/// <summary>Helper to stop the calibration BER timer.</summary> /// <summary>Helper to stop the calibration BER timer.</summary>
void timerStop(); void timerStop();
/// <summary>Retrieve the current status from the air interface modem.</summary>
void getStatus();
/// <summary>Prints the current status of the calibration.</summary> /// <summary>Prints the current status of the calibration.</summary>
void printStatus(); void printStatus();

@ -498,7 +498,8 @@ bool Control::writeControlRF()
return false; return false;
} }
if (m_ccSeq == 6U) { const uint8_t maxSeq = 7U;
if (m_ccSeq == maxSeq) {
m_ccSeq = 0U; m_ccSeq = 0U;
} }
@ -508,8 +509,12 @@ bool Control::writeControlRF()
if (m_netState == RS_NET_IDLE && m_rfState == RS_RF_LISTENING) { if (m_netState == RS_NET_IDLE && m_rfState == RS_RF_LISTENING) {
m_trunk->writeRF_ControlData(m_ccFrameCnt, m_ccSeq, true); m_trunk->writeRF_ControlData(m_ccFrameCnt, m_ccSeq, true);
m_ccFrameCnt++;
m_ccSeq++; m_ccSeq++;
if (m_ccSeq == maxSeq) {
m_ccFrameCnt++;
}
return true; return true;
} }

@ -1139,7 +1139,7 @@ TrunkPacket::TrunkPacket(Control* p25, network::BaseNetwork* network, bool dumpT
m_noMessageAck(true), m_noMessageAck(true),
m_adjSiteUpdateTimer(1000U), m_adjSiteUpdateTimer(1000U),
m_adjSiteUpdateInterval(ADJ_SITE_TIMER_TIMEOUT), m_adjSiteUpdateInterval(ADJ_SITE_TIMER_TIMEOUT),
m_dumpTSBK(false), m_dumpTSBK(dumpTSBKData),
m_verbose(verbose), m_verbose(verbose),
m_debug(debug) m_debug(debug)
{ {
@ -1201,66 +1201,70 @@ void TrunkPacket::writeNetworkRF(const uint8_t* data, bool autoReset)
/// <param name="adjSS"></param> /// <param name="adjSS"></param>
void TrunkPacket::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS) void TrunkPacket::writeRF_ControlData(uint8_t frameCnt, uint8_t n, bool adjSS)
{ {
uint8_t i = 0U, seqCnt = 0U;
if (!m_p25->m_control) if (!m_p25->m_control)
return; return;
// loop to generate 6 control sequences
if (frameCnt == 255U) {
seqCnt = 6U;
}
do
{
resetRF(); resetRF();
if (m_debug) { if (m_debug) {
LogDebug(LOG_P25, "writeRF_ControlData, mbfCnt = %u, frameCnt = %u, seq = %u, adjSS = %u", m_mbfCnt, frameCnt, n, adjSS); LogDebug(LOG_P25, "writeRF_ControlData, mbfCnt = %u, frameCnt = %u, seq = %u, adjSS = %u", m_mbfCnt, frameCnt, n, adjSS);
} }
bool forcePad = false;
bool alt = (frameCnt % 2U) > 0U;
switch (n) switch (n)
{ {
/** required data */
case 0:
default:
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_IDEN_UP);
break;
case 1: case 1:
if (alt)
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST);
else
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_NET_STS_BCAST);
break; break;
case 2: case 2:
if (alt)
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_NET_STS_BCAST); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_NET_STS_BCAST);
else
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST);
break; break;
case 3: case 3:
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_SNDCP_CH_ANN); if (alt)
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST);
else
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_NET_STS_BCAST);
break; break;
/** extra data */
case 4: case 4:
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_SNDCP_CH_ANN);
break;
case 5:
// write ADJSS // write ADJSS
if (adjSS) { if (adjSS && m_adjSiteTable.size() > 0) {
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_ADJ_STS_BCAST); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_ADJ_STS_BCAST);
break; break;
} else {
forcePad = true;
} }
case 5: case 6:
// write SCCB // write SCCB
if (adjSS) { if (adjSS && m_sccbTable.size() > 0) {
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_SCCB_EXP); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_SCCB_EXP);
break; break;
} }
case 0:
default:
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_IDEN_UP);
break;
} }
if (seqCnt > 0U)
n++;
i++;
} while (i <= seqCnt);
// should we insert the BSI bursts? // should we insert the BSI bursts?
bool bsi = (frameCnt % 64U) == 0U; bool bsi = (frameCnt % 127U) == 0U;
if (bsi || frameCnt == 255U) { if (bsi && n > 3U) {
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_MOT_CC_BSI); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_MOT_CC_BSI);
} }
// add padding after the 4th sequence // add padding after the 4th sequence
if (seqCnt > 4U) { if (n == 6U || forcePad) {
// pad MBF if we have 1 queued TSDUs // pad MBF if we have 1 queued TSDUs
if (m_mbfCnt == 1U) { if (m_mbfCnt == 1U) {
queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST); queueRF_TSBK_Ctrl_MBF(TSBK_OSP_RFSS_STS_BCAST);

Loading…
Cancel
Save

Powered by TurnKey Linux.