Sample code for Band Capabilities
//--------------------------------------------------------------------------------------------------/*** Test: Get platform band capabilities.** le_mrc_GetBandCapabilities() API test* le_mrc_GetLteBandCapabilities() API test* le_mrc_GetTdScdmaBandCapabilities() API test*///--------------------------------------------------------------------------------------------------//--------------------------------------------------------------------------------------------------/*** Test band capabilities according to RAT*///--------------------------------------------------------------------------------------------------static bool Test_BandCapabilities(le_mrc_RatBitMask_t ratMask,le_result_t res){bool test = true;le_mrc_RatBitMask_t bitMaskOrigin;// Get the current rat preference.LE_ASSERT_OK(le_mrc_GetRatPreferences(&bitMaskOrigin));{test = false;}// Restore origin RAT.LE_ASSERT_OK(le_mrc_SetRatPreferences(bitMaskOrigin));return test;}//--------------------------------------------------------------------------------------------------/*** Test: Get platform band capabilities.*///--------------------------------------------------------------------------------------------------static void Testle_mrc_GetBandCapabilities(void){le_mrc_BandBitMask_t bands;le_mrc_LteBandBitMask_t lteBands;le_mrc_TdScdmaBandBitMask_t tdScdmaBands;le_result_t res;res = le_mrc_GetBandCapabilities(&bands);// Not supported on all platformswitch(res){case LE_OK:LE_ASSERT(0L != bands);LE_INFO("Get 2G/3G Band Capabilities bit mask: 0x%016"PRIX64, (uint64_t)bands);break;case LE_UNSUPPORTED:LE_WARN("Unable to get Band Capabilities on this platform");break;default:LE_FATAL("le_mrc_GetBandCapabilities failed");break;}// Test if LTE Band Capabilities are supportedres = le_mrc_GetLteBandCapabilities(<eBands);LE_ASSERT(true == Test_BandCapabilities(LE_MRC_BITMASK_RAT_LTE, res));switch(res){case LE_OK:LE_ASSERT(0 != lteBands);LE_INFO("Get LTE Band Capabilities bit mask: 0x%016"PRIX64, (uint64_t)lteBands);break;case LE_UNSUPPORTED:LE_WARN("Unable to get Band Capabilities on this platform");break;default:LE_FATAL("le_mrc_GetLteBandCapabilities failed");break;}// Test if TD-SCDMA Band Capabilities are supportedres = le_mrc_GetTdScdmaBandCapabilities(&tdScdmaBands);LE_ASSERT(true == Test_BandCapabilities(LE_MRC_BITMASK_RAT_TDSCDMA, res));switch(res){case LE_OK:LE_ASSERT(0 != tdScdmaBands);LE_INFO("Get TD-SCDMA Band Capabilities bit mask: 0x%016"PRIX64,(uint64_t)tdScdmaBands);break;case LE_UNSUPPORTED:LE_WARN("Unable to get Band Capabilities on this platform");break;default:LE_FATAL("le_mrc_GetTdScdmaBandCapabilities failed");break;}}