Sample code for Signal Quality
//--------------------------------------------------------------------------------------------------/*** Test: Network Registration State + Signal Quality.**///--------------------------------------------------------------------------------------------------static void Testle_mrc_GetStateAndQual(void){le_result_t res;le_mrc_NetRegState_t state;uint32_t quality;res = le_mrc_GetNetRegState(&state);res = le_mrc_GetSignalQual(&quality);LE_ASSERT(quality<=5);}//--------------------------------------------------------------------------------------------------/*** Test: Get Signal Metrics.**///--------------------------------------------------------------------------------------------------static void Testle_mrc_GetSignalMetrics(void){le_result_t res;le_mrc_Rat_t rat;int32_t rxLevel = 0;uint32_t er = 0;int32_t ecio = 0;int32_t rscp = 0;int32_t sinr = 0;int32_t rsrq = 0;int32_t rsrp = 0;int32_t snr = 0;int32_t io = 0;le_mrc_MetricsRef_t metricsRef = le_mrc_MeasureSignalMetrics();LE_ASSERT(metricsRef != NULL);rat = le_mrc_GetRatOfSignalMetrics(metricsRef);LE_INFO("RAT of signal metrics is %d",rat);switch(rat){case LE_MRC_RAT_GSM:res = le_mrc_GetGsmSignalMetrics(metricsRef, &rxLevel, &er);LE_INFO("GSM metrics rxLevel.%ddBm, er.%d", rxLevel, er);break;case LE_MRC_RAT_UMTS:case LE_MRC_RAT_TDSCDMA:res = le_mrc_GetUmtsSignalMetrics(metricsRef, &rxLevel, &er, &ecio, &rscp, &sinr);LE_INFO("UMTS/TD-SCDMA metrics rxLevel.%ddBm, er.%d, ecio.%010.1fdB,""rscp.%ddBm, sinr.%ddB", rxLevel, er, ((double)ecio/10), rscp, sinr);break;case LE_MRC_RAT_LTE:res = le_mrc_GetLteSignalMetrics(metricsRef, &rxLevel, &er, &rsrq, &rsrp, &snr);LE_INFO("LTE metrics rxLevel.%ddBm, er.%d, rsrq.%010.1fdB, ""rsrp.%010.1fdBm, snr.%010.1fdB",rxLevel, er, ((double)rsrq/10), ((double)rsrp/10), ((double)snr/10));break;case LE_MRC_RAT_CDMA:res = le_mrc_GetCdmaSignalMetrics(metricsRef, &rxLevel, &er, &ecio, &sinr, &io);LE_INFO("CDMA metrics rxLevel.%ddBm, er.%d, ecio.%010.1fdB, ""sinr.%ddB, io.%ddBm",rxLevel, er, ((double)ecio/10), sinr, io);break;default:LE_FATAL("Unknown RAT!");break;}le_mrc_DeleteSignalMetrics(metricsRef);}