//-------------------------------------------------------------------------------------------------- le_result_t pa_mdc_StartSessionIPV4 ( uint32_t profileIndex, ///< [IN] The profile to use pa_mdc_CallRef_t* callRefPtr ///< [OUT] Reference used for stopping the data session ) { le_result_t result=LE_NOT_POSSIBLE; if ( GetCurrentDataSessionIndex() != INVALID_PROFILE_INDEX ) { return LE_DUPLICATE; } // Always executed because: // - if GPRS is already attached it doesn't do anything and then it returns OK // - if GPRS is not attached it will attach it and then it returns OK on success if ( AttachGPRS(true) != LE_OK ) { return LE_NOT_POSSIBLE; } // Always executed because: // - if the context is already activated it doesn't do anything and then it returns OK // - if the context is not activated it will attach it and then it returns OK on success if ( ActivateContext(profileIndex,true) != LE_OK ) { return LE_NOT_POSSIBLE; } if ( (result = EstablishConnection(profileIndex)) != LE_OK ) { return LE_NOT_POSSIBLE; } if (result==LE_OK) { SetCurrentDataSessionIndex(profileIndex); memcpy(callRefPtr, &profileIndex, sizeof(void*)); } else { SetCurrentDataSessionIndex(INVALID_PROFILE_INDEX); } return result; }
//-------------------------------------------------------------------------------------------------- le_result_t pa_mdc_StartSessionIPV4 ( uint32_t profileIndex ///< [IN] The profile to use ) { le_result_t result=LE_FAULT; if ( GetCurrentDataSessionIndex() != INVALID_PROFILE_INDEX ) { return LE_DUPLICATE; } // Always executed because: // - if GPRS is already attached it doesn't do anything and then it returns OK // - if GPRS is not attached it will attach it and then it returns OK on success if ( AttachGPRS(true) != LE_OK ) { return LE_FAULT; } // Always executed because: // - if the context is already activated it doesn't do anything and then it returns OK // - if the context is not activated it will attach it and then it returns OK on success if ( ActivateContext(profileIndex,true) != LE_OK ) { return LE_FAULT; } if ( (result = EstablishConnection(profileIndex)) != LE_OK ) { SetCurrentDataSessionIndex(INVALID_PROFILE_INDEX); return LE_FAULT; } SetCurrentDataSessionIndex(profileIndex); return result; }