本文整理汇总了C++中RIL_onRequestComplete函数的典型用法代码示例。如果您正苦于以下问题:C++ RIL_onRequestComplete函数的具体用法?C++ RIL_onRequestComplete怎么用?C++ RIL_onRequestComplete使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RIL_onRequestComplete函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestStkIsRunning
/**
* RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING
*
* Turn on STK unsol commands.
*/
void requestStkIsRunning(void *data, size_t datalen, RIL_Token t)
{
char *cmd;
int err;
ATResponse *atresponse = NULL;
asprintf(&cmd, "AT*STKC=1,\"000000000000000000\"");
err = at_send_command(cmd, &atresponse);
free(cmd);
if (err < 0 || atresponse->success == 0)
goto error;
/* Android 2.1 does not handle the response to this RIL command
This is seen as an error message in the radio log:
"[0001]< RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING exception, possible
invalid RIL response" */
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
finally:
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
goto finally;
}
示例2: requestExplicitCallTransfer
void requestExplicitCallTransfer(void *data, size_t datalen, RIL_Token t)
{
/* MTK proprietary start */
int ret;
ATResponse *p_response = NULL;
//BEGIN mtk03923 [20120210][ALPS00114093]
if (inDTMF) {
RIL_onRequestComplete(t, RIL_E_CANCELLED, NULL, 0); // RIL_E_GENERIC_FAILURE
return;
}
//END mtk03923 [20120210][ALPS00114093]
ret = at_send_command("AT+CHLD=4", &p_response, CC_CHANNEL_CTX);
if (ret < 0 || p_response->success == 0)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
at_response_free(p_response);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
at_response_free(p_response);
/* MTK proprietary end */
}
示例3: requestSendUSSD
void requestSendUSSD(void *data, size_t datalen, RIL_Token t)
{
ATResponse *p_response = NULL;
int err = 0;
char* ussdRequest;
char* cmd;
at_send_command("AT+CSCS=\"GSM\"", NULL);
ussdStatus = 1;
ussdRequest = (char*)(data);
asprintf(&cmd, "AT+CUSD=1,%s,15", ussdRequest);
err = at_send_command(cmd, &p_response);
free(cmd);
if (err < 0 || p_response->success == 0) {
goto error;
}
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
at_response_free(p_response);
return;
error:
at_response_free(p_response);
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
示例4: requestGSMSetBroadcastSMSConfig
void requestGSMSetBroadcastSMSConfig(void *data, size_t datalen, RIL_Token t)
{
ATResponse *atresponse = NULL;
int err;
char *cmd;
RIL_GSM_BroadcastSmsConfigInfo* configInfo = (RIL_GSM_BroadcastSmsConfigInfo*)data;
if (!configInfo->selected)
goto error;
/* TODO Should this test be done or shall we just let the modem return error. */
if ((configInfo->toServiceId - configInfo->fromServiceId) > 10)
goto error;
asprintf(&cmd, "AT+CSCB=0,\"%d-%d\",\"%d-%d\"", configInfo->fromServiceId, configInfo->toServiceId, configInfo->fromCodeScheme, configInfo->toCodeScheme);
err = at_send_command(cmd, &atresponse);
if (err < 0 || atresponse->success == 0)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
finally:
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
goto finally;
}
示例5: requestStkSetProfile
/**
* RIL_REQUEST_STK_SET_PROFILE
*
* Download the STK terminal profile as part of SIM initialization
* procedure.
*/
void requestStkSetProfile(void *data, size_t datalen, RIL_Token t)
{
#ifdef USE_U8500_RIL
/* Currently this request is not supported. */
RIL_onRequestComplete(t, RIL_E_REQUEST_NOT_SUPPORTED, NULL, 0);
return;
#else
char *cmd;
int err;
ATResponse *atresponse = NULL;
const char *profile = (const char *) data;
asprintf(&cmd, "AT*STKC=0,\"%s\"", profile);
err = at_send_command(cmd, &atresponse);
free(cmd);
if (err < 0 || atresponse->success == 0)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
finally:
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
goto finally;
#endif
}
示例6: requestSMSAcknowledge
static void requestSMSAcknowledge(void *data, size_t datalen, RIL_Token t)
{
int ackSuccess = ((int *)data)[0];
LOGV("requestSMSAcknowledge()");
if (ackSuccess == 1)
{
if(ipcFixSMS() != 0)
{
LOGE("requestSMSAcknowledge() ipcFixSMS() failed");
goto error;
}
LOGD("requestSMSAcknowledge() sending SMS_ACKNOWLEDGE\n");
}
else if (ackSuccess == 0) {
LOGD("requestSMSAcknowledge() not sending SMS_ACKNOWLEDGE\n");
}
else {
LOGE("unsupported arg to RIL_REQUEST_SMS_ACKNOWLEDGE\n");
goto error;
}
LOGV("requestSMSAcknowledge() sucsessfull");
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
示例7: requestWriteSmsToSim
void requestWriteSmsToSim(void *data, size_t datalen, RIL_Token t)
{
RIL_SMS_WriteArgs *p_args;
char *cmd;
int length;
int err;
ATResponse *p_response = NULL;
p_args = (RIL_SMS_WriteArgs *)data;
length = strlen(p_args->pdu)/2;
asprintf(&cmd, "AT+CMGW=%d,%d", length, p_args->status);
err = at_send_command_sms(cmd, p_args->pdu, "+CMGW:", &p_response);
if (err != 0 || p_response->success == 0) goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
at_response_free(p_response);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
at_response_free(p_response);
}
示例8: requestSetNetworkSelectionManual
/**
* RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL
*
* Manually select a specified network.
*
* The radio baseband/RIL implementation is expected to fall back to
* automatic selection mode if the manually selected network should go
* out of range in the future.
*/
void requestSetNetworkSelectionManual(void *data, size_t datalen,
RIL_Token t)
{
/*
* AT+COPS=[<mode>[,<format>[,<oper>[,<AcT>]]]]
* <mode> = 4 = Manual (<oper> field shall be present and AcT optionally) with fallback to automatic if manual fails.
* <format> = 2 = Numeric <oper>, the number has structure:
* (country code digit 3)(country code digit 2)(country code digit 1)
* (network code digit 2)(network code digit 1)
*/
(void) datalen;
int err = 0;
const char *mccMnc = (const char *) data;
/* Check inparameter. */
if (mccMnc == NULL)
goto error;
/* Build and send command. */
err = at_send_command("AT+COPS=1,2,\"%s\"", mccMnc);
if (err != AT_NOERROR)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
示例9: requestStkSendTerminalResponse
/**
* RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE
*
* Requests to send a terminal response to SIM for a received
* proactive command.
*/
void requestStkSendTerminalResponse(void *data, size_t datalen,
RIL_Token t)
{
char *cmd;
int err;
ATResponse *atresponse = NULL;
const char *stkResponse = (const char *) data;
asprintf(&cmd, "AT*STKR=\"%s\"", stkResponse);
err = at_send_command(cmd, &atresponse);
free(cmd);
if (err < 0 || atresponse->success == 0)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
finally:
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
goto finally;
}
示例10: ipc_gprs_pdp_context_enable_complete
void ipc_gprs_pdp_context_enable_complete(struct ipc_message_info *info)
{
struct ipc_gen_phone_res *phone_res = (struct ipc_gen_phone_res *) info->data;
struct ril_gprs_connection *gprs_connection;
int rc;
gprs_connection = ril_gprs_connection_get_token(reqGetToken(info->aseq));
if(!gprs_connection) {
LOGE("Unable to find GPRS connection, aborting");
RIL_onRequestComplete(reqGetToken(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
rc = ipc_gen_phone_res_check(phone_res);
if(rc < 0) {
LOGE("There was an error, aborting PDP context complete");
gprs_connection->fail_cause = PDP_FAIL_ERROR_UNSPECIFIED;
gprs_connection->token = (RIL_Token) 0x00;
ril_state.gprs_last_failed_cid = gprs_connection->cid;
RIL_onRequestComplete(reqGetToken(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
LOGD("Waiting for IP configuration!");
}
示例11: pollOperatorSelected
/**
* Poll +COPS? and return a success, or if the loop counter reaches
* REPOLL_OPERATOR_SELECTED, return generic failure.
*/
static void pollOperatorSelected(void *params)
{
int err = 0;
int response = 0;
char *line = NULL;
ATResponse *atresponse = NULL;
struct operatorPollParams *poll_params;
RIL_Token t;
assert(params != NULL);
poll_params = (struct operatorPollParams *) params;
t = poll_params->t;
if (poll_params->loopcount >= REPOLL_OPERATOR_SELECTED)
goto error;
err = at_send_command_singleline("AT+COPS?", "+COPS:", &atresponse);
if (err != AT_NOERROR)
goto error;
line = atresponse->p_intermediates->line;
err = at_tok_start(&line);
if (err < 0)
goto error;
err = at_tok_nextint(&line, &response);
if (err < 0)
goto error;
/* If we don't get more than the COPS: {0-4} we are not registered.
Loop and try again. */
if (!at_tok_hasmore(&line)) {
switch (s_registrationDeniedReason) {
case IMSI_UNKNOWN_IN_HLR: /* fall through */
case ILLEGAL_ME:
RIL_onRequestComplete(t, RIL_E_ILLEGAL_SIM_OR_ME, NULL, 0);
free(poll_params);
break;
default:
poll_params->loopcount++;
enqueueRILEvent(RIL_EVENT_QUEUE_PRIO, pollOperatorSelected,
poll_params, &TIMEVAL_OPERATOR_SELECT_POLL);
}
} else {
/* We got operator, throw a success! */
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
free(poll_params);
}
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
free(poll_params);
at_response_free(atresponse);
return;
}
示例12: ipc_gprs_pdp_context_disable_complete
void ipc_gprs_pdp_context_disable_complete(struct ipc_message_info *info)
{
struct ipc_gen_phone_res *phone_res = (struct ipc_gen_phone_res *) info->data;
struct ril_gprs_connection *gprs_connection;
int rc;
gprs_connection = ril_gprs_connection_get_token(reqGetToken(info->aseq));
if(!gprs_connection) {
LOGE("Unable to find GPRS connection, aborting");
RIL_onRequestComplete(reqGetToken(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
rc = ipc_gen_phone_res_check(phone_res);
if(rc < 0) {
LOGE("There was an error, aborting PDP context complete");
// RILJ is not going to ask for fail reason
ril_gprs_connection_del(gprs_connection);
RIL_onRequestComplete(reqGetToken(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
LOGD("Waiting for GPRS call status");
}
示例13: requestStkHandleCallSetupRequestedFromSIM
/**
* RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
*
* When STK application gets RIL_UNSOL_STK_CALL_SETUP, the call actually has
* been initialized by ME already. (We could see the call has been in the 'call
* list') So, STK application needs to accept/reject the call according as user
* operations.
*/
void requestStkHandleCallSetupRequestedFromSIM(void *data,
size_t datalen, RIL_Token t)
{
char *cmd;
int err;
int answer = 0;
ATResponse *atresponse = NULL;
if(((int *)data)[0] > 0 ){
answer = 1;
}
asprintf(&cmd, "AT*ESHLVOCR=%d", answer);
err = at_send_command(cmd, &atresponse);
free(cmd);
if (err < 0 || atresponse->success == 0)
goto error;
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
finally:
at_response_free(atresponse);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
goto finally;
}
示例14: requestChangePassword
void requestChangePassword(void *data, size_t datalen, RIL_Token t,
char *facility, int request)
{
int err = 0;
char *oldPassword = NULL;
char *newPassword = NULL;
int num_retries = -1;
if (datalen != 3 * sizeof(char *) || strlen(facility) != 2)
goto error;
oldPassword = ((char **) data)[0];
newPassword = ((char **) data)[1];
err = at_send_command("AT+CPWD=\"%s\",\"%s\",\"%s\"", facility,
oldPassword, newPassword);
if (err != AT_NOERROR)
goto error;
num_retries = getNumRetries(request);
RIL_onRequestComplete(t, RIL_E_SUCCESS, &num_retries, sizeof(int *));
return;
error:
if (at_get_cme_error(err) == CME_INCORRECT_PASSWORD) {
num_retries = getNumRetries(request);
RIL_onRequestComplete(t, RIL_E_PASSWORD_INCORRECT, &num_retries, sizeof(int *));
} else
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
示例15: requestSwitchWaitingOrHoldingAndActive
void requestSwitchWaitingOrHoldingAndActive(void *data, size_t datalen, RIL_Token t)
{
int ret;
ATResponse *p_response = NULL;
//BEGIN mtk03923 [20120210][ALPS00114093]
if (inDTMF) {
RIL_onRequestComplete(t, RIL_E_CANCELLED, NULL, 0); // RIL_E_GENERIC_FAILURE
return;
}
//END mtk03923 [20120210][ALPS00114093]
ret = at_send_command("AT+CHLD=2", &p_response, CC_CHANNEL_CTX);
if (ret < 0 || p_response->success == 0)
goto error;
#ifdef WORKAROUND_ERRONEOUS_ANSWER
s_expectAnswer = 1;
#endif /* WORKAROUND_ERRONEOUS_ANSWER */
RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
at_response_free(p_response);
return;
error:
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
at_response_free(p_response);
}