g_hConnectionProfileHandleCellular = NULL;
g_hConnectionProfileHandleMMS = NULL;
g_hConenctionHandle = NULL;
+ connection_cellular_state_e eState;
int nRet = connection_create(&g_hConenctionHandle);
if ( false == bTelFeatureSupported && false == bWifiFeatureSupported && false == bBtFeatureSupported && false == bEthernetFeatureSupported )
g_hConenctionHandle = NULL;
return;
}
+
+ nRet = connection_get_cellular_state(g_hConenctionHandle, &eState);
+ if ( nRet != CONNECTION_ERROR_NONE )
+ {
+ FPRINTF("[Line: %d][%s] connection_get_cellular_state failed in startup, returned error %s\\n", __LINE__, API_NAMESPACE, ConnectionGetError(nRet));
+ g_nConnectionPreconditionError = 1;
+ return;
+ }
+ if (eState == CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE)
+ {
+ FPRINTF("[Line: %d][%s] Cellular state is out of service\\n", __LINE__, API_NAMESPACE);
+ g_bFeatureNotSupported = true;
+ return;
+ }
+
if ( ConnectionManager_get_celluar_profile(g_hConenctionHandle, &g_hConnectionProfileHandleCellular) == 0 )
{
if ( false == bTelFeatureSupported )