Sample code for Data Statistics
//--------------------------------------------------------------------------------------------------/*** Test the connectivity.**///--------------------------------------------------------------------------------------------------void TestConnectivity(le_mdc_ProfileRef_t profileRef){le_result_t res;char systemCmd[200] = {0};le_mdc_DataBearerTechnology_t downlinkDataBearerTech;le_mdc_DataBearerTechnology_t uplinkDataBearerTech;LE_ASSERT(le_mdc_GetDataBearerTechnology(profileRef,&downlinkDataBearerTech,&uplinkDataBearerTech) == LE_OK);LE_INFO("downlinkDataBearerTech %d, uplinkDataBearerTech %d",downlinkDataBearerTech, uplinkDataBearerTech);// Get interface name== LE_OK);if ( le_mdc_IsIPv4(profileRef) ){snprintf(systemCmd, sizeof(systemCmd), "ping -c 4 www.sierrawireless.com -I %s", itfName);}else{// TODO ping6 needs raw access to socket and therefore root permissions => find a different// way to test the connectivitysnprintf(systemCmd, sizeof(systemCmd), "ping6 -c 4 www.sierrawireless.com -I %s", itfName);}res = system(systemCmd);if (res != LE_OK){le_mdc_StopSession(profileRef);}LE_ASSERT(res == LE_OK);// Get data countersuint64_t rxBytes=0, txBytes=0;LE_ASSERT( le_mdc_GetBytesCounters(&rxBytes, &txBytes) == LE_OK );}