static TelReturn __call_list_get(CoreObject *co, gboolean flag);
-
static TelCallType __call_type(int type)
{
dbg("Entry");
return TEL_CALL_TYPE_VIDEO;
default:
- err("invalid call type, returing default call type as voice");
+ err("invalid call type, returning default call type as voice");
return TEL_CALL_TYPE_VOICE;
}
}
}
}
-static void __call_branch_by_status(CoreObject *co, CallObject *call_obj, TelCallState call_state)
+static void __call_branch_by_status(CoreObject *co, CallObject *call_obj,
+ TelCallState call_state)
{
unsigned int call_id;
TelCallType call_type;
tcore_call_object_get_active_line(call_obj, &incoming.active_line);
/* Send notification */
- tcore_object_send_notification(co, command, sizeof(TelCallIncomingInfo), &incoming);
+ tcore_object_send_notification(co, command,
+ sizeof(TelCallIncomingInfo), &incoming);
return;
}
if (NULL == resp) {
err("Number is NULL");
} else {
- // Strike off double quotes
+ /* Strike off double quotes */
num = tcore_at_tok_extract(resp);
dbg("Number: [%s]", num);
g_slist_free(list);
return;
}
- g_slist_free(list);
call_obj = tcore_call_object_find_by_id(co, call_id);
if (call_obj != NULL) {
tcore_check_return_assert(resp_cb_data != NULL);
if (at_resp && at_resp->success) {
- result = TEL_CALL_RESULT_SUCCESS;
if (NULL == at_resp->lines) {
err("invalid response received");
return;
lines = (GSList *) at_resp->lines;
count = g_slist_length(lines);
- dbg("Total records : %d", g_slist_length(lines));
+ dbg("Total records : %d", count);
if (0 == count) {
err("Call count is zero");
return;
}
-
+ result = TEL_CALL_RESULT_SUCCESS;
dbg("RESPONSE OK");
/* parse +CLCC notification parameter */
TelReturn ret;
/* Response callback data */
- resp_cb_data = imc_create_resp_cb_data(cb, cb_data, func_name, strlen(func_name) + 1);
+ resp_cb_data = imc_create_resp_cb_data(cb, cb_data, func_name,
+ strlen(func_name) + 1);
/* Send Request to modem */
ret = tcore_at_prepare_and_send_request(co,
* Response -
* Success:
*[+CLCC: <id1>, <dir>, <stat>, <mode>,<mpty>[,<number>,<type>[,<alpha>[,<priority>]]]
- *[<CR><LF> +CLCC: <id2>,<dir>,<stat>,<mode>,<mpty>[,<number>,<type>[,<alpha>[,<priority>]]][\85]]]
+ *
* OK
* Failure:
* +CME ERROR: <error>
static TelReturn __call_list_get(CoreObject *co, gboolean flag)
{
ImcRespCbData *resp_cb_data;
- TelReturn ret =TEL_RETURN_FAILURE;
+ TelReturn ret = TEL_RETURN_FAILURE;
dbg("Entry");
if (NULL == co) {
* 4 ringing (MT call)
* 5 waiting (MT call)
* 6 disconnected
-* 7 connected (indicates the completion of a call setup first time for MT and MO calls \96 this is reported in
-addition to state active)
+* 7 connected (indicates the completion of a call setup first time for MT and MO calls
+* this is reported in addition to state active)
*/
static gboolean on_notification_imc_call_status(CoreObject *co, const void *data,
void *user_data)
call_handle = g_slist_nth_data(tokens, 0);
if (NULL == call_handle) {
- err("call_id missing from %XCALLSTAT indiaction");
+ err("call id missing from %XCALLSTAT indication");
goto OUT;
}
call_id = atoi(call_handle);
state = g_slist_nth_data(tokens, 1);
if (NULL == state) {
- err("State is missing from %XCALLSTAT indication");
+ err("call state is missing from %XCALLSTAT indication");
goto OUT;
}
status = atoi(state);
- dbg("call_id[%d], status[%d]", call_id, status);
+ dbg("call id[%d], status[%d]", call_id, status);
switch (status) {
case STATUS_INCOMING:
char *cmd = 0;
int index = 0;
int code2 = -1;
- char number[TEL_CALL_CALLING_NUMBER_LEN_MAX + 1] = {'\0',};
+ char *number = NULL;
dbg("entry");
/* parse <code2> */
resp = g_slist_nth_data(tokens, 0);
if (NULL == resp) {
- err("Code2 is missing from %CSSU indiaction");
+ err("Code2 is missing from +CSSU indication");
tcore_at_tok_free(tokens);
return TRUE;
}
if ((resp = g_slist_nth_data(tokens, 2))) {
/* Strike off double quotes */
- int len = strlen(resp) - 2;
- memcpy(number, resp + 1, len);
- number[len] = '\0';;
+ number = tcore_at_tok_extract(resp);
}
dbg("+CSSU: <code2> = %d <index> = %d <number> = %s ", code2, index, number);
if (command != TCORE_NOTIFICATION_UNKNOWN)
tcore_object_send_notification(co, command, 0, NULL);
tcore_at_tok_free(tokens);
+ g_free(number);
return TRUE;
}
/* parse <code1> */
resp = g_slist_nth_data(tokens, 0);
if (NULL == resp) {
- err("<code1> is missing from %CSSI indiaction");
+ err("<code1> is missing from %CSSI indication");
tcore_at_tok_free(tokens);
return TRUE;
}
CoreObject *co = tcore_pending_ref_core_object(p);
ImcRespCbData *resp_cb_data = user_data;
- TelCallResult result;
+ TelCallResult result = TEL_CALL_RESULT_FAILURE;
dbg("entry");
tcore_check_return_assert(co != NULL);
if (at_resp && at_resp->success) {
result = TEL_CALL_RESULT_SUCCESS;
} else {
- err("ERROR[%s]",at_resp->final_response);
- result = TEL_CALL_RESULT_FAILURE;
- /*TODO - need to map CME error and final response error to TelCallResult */
+ err("ERROR[%s] CME error[%s]",at_resp->final_response,
+ at_resp->lines->data);
+ /*
+ * TODO - need to map CME error and final
+ * response error to TelCallResult
+ */
}
dbg("%s: [%s]", IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data),
char *resp_str = NULL;
gboolean error;
- TelCallResult result = TEL_CALL_RESULT_FAILURE; // TODO: XDRV error mapping is required
+ /* TODO: XDRV error mapping required */
+ TelCallResult result = TEL_CALL_RESULT_FAILURE;
dbg("Enter");
tcore_check_return_assert(co != NULL);
tokens = tcore_at_tok_new(line->data);
if (!g_slist_nth_data(tokens, 0)) {
- err("group_id is missing");
+ err("group_id missing");
goto OUT;
}
if (!g_slist_nth_data(tokens, 1)) {
- err(" function_id is missing");
+ err(" function_id missing");
goto OUT;
}
goto OUT;
}
- /* Fetch from resp_cb_data */
- volume_info = (struct imc_set_volume_info *)IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
+ /* Fetch volume_info from resp_cb_data */
+ volume_info = (struct imc_set_volume_info *)
+ IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
dbg("volume info index[%d]", volume_info->next_index);
if (xdrv_set_volume[volume_info->next_index] == NULL) {
at_cmd = g_strdup_printf("%s%s",
xdrv_set_volume[volume_info->next_index], vol);
- /* Increament index to point to next command */
+ /* Increment index to point to next xdrv command */
volume_info->next_index += 1;
/* Send Request to modem */
at_cmd, "+XDRV",
TCORE_AT_COMMAND_TYPE_SINGLELINE,
NULL,
- on_response_imc_call_set_volume_info, resp_cb_data,
- on_send_imc_request, NULL);
+ on_response_imc_call_set_volume_info,
+ resp_cb_data, on_send_imc_request, NULL);
IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "imc_call_set_volume_info");
g_free(at_cmd);
line = at_resp->lines;
tokens = tcore_at_tok_new(line->data);
if (!g_slist_nth_data(tokens, 0)) {
- err("group_id is missing");
+ err("group_id missing");
goto OUT;
}
if (!(resp_str = g_slist_nth_data(tokens, 1))) {
- err(" function_id is missing");
+ err("function_id missing");
goto OUT;
}
-
xdrv_func_id = atoi(resp_str);
- resp_str = g_slist_nth_data(tokens, 2);
- if (resp_str) {
- error = atoi(resp_str);
- if (error) {
- err("RESPONSE NOK");
- goto OUT;
- } else {
- if (xdrv_func_id == 4) {
- /* Send next command to configure destination device type */
- gchar *at_cmd;
- TelReturn ret;
- gint *device_type = IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
-
- at_cmd = g_strdup_printf("AT+XDRV=40,5,2,0,0,0,0,0,1,0,1,0,%d",
- *device_type);
-
- ret = tcore_at_prepare_and_send_request(co,
- at_cmd, "+XDRV",
- TCORE_AT_COMMAND_TYPE_SINGLELINE,
- NULL,
- on_response_imc_call_set_sound_path, resp_cb_data,
- on_send_imc_request, NULL);
- IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "imc_call_set_sound_path");
- g_free(at_cmd);
-
- return;
- }
- dbg("RESPONSE OK");
- result = TEL_CALL_RESULT_SUCCESS;
- }
+ if (!(resp_str = g_slist_nth_data(tokens, 2))) {
+ err("RESPONSE NOK");
+ goto OUT;
+ }
+ error = atoi(resp_str);
+ if (error) {
+ err("RESPONSE NOK");
+ goto OUT;
}
+
+ if (xdrv_func_id == 4) {
+ /* Send next command to configure destination device type */
+ gchar *at_cmd;
+ TelReturn ret;
+ gint *device_type = IMC_GET_DATA_FROM_RESP_CB_DATA(resp_cb_data);
+
+ at_cmd = g_strdup_printf("AT+XDRV=40,5,2,0,0,0,0,0,1,0,1,0,%d",
+ *device_type);
+
+ ret = tcore_at_prepare_and_send_request(co,
+ at_cmd, "+XDRV",
+ TCORE_AT_COMMAND_TYPE_SINGLELINE,
+ NULL,
+ on_response_imc_call_set_sound_path, resp_cb_data,
+ on_send_imc_request, NULL);
+ IMC_CHECK_REQUEST_RET(ret, resp_cb_data, "imc_call_set_sound_path");
+ g_free(at_cmd);
+
+ return;
+ }
+ dbg("RESPONSE OK");
+ result = TEL_CALL_RESULT_SUCCESS;
}
OUT :
tcore_check_return_assert(resp_cb_data != NULL);
if (at_resp && at_resp->success) {
- result = TEL_CALL_RESULT_SUCCESS;
line = (((GSList *)at_resp->lines)->data);
tokens = tcore_at_tok_new(line);
resp_str = g_slist_nth_data(tokens, 0);
if (!g_slist_nth_data(tokens, 0)) {
- err("group_id is missing");
- result = TEL_CALL_RESULT_FAILURE;
+ err("group_id missing");
goto OUT;
}
if (!g_slist_nth_data(tokens, 1)) {
- err(" function_id is missing");
- result = TEL_CALL_RESULT_FAILURE;
+ err("function_id missing");
goto OUT;
}
resp_str = g_slist_nth_data(tokens, 2);
- if (resp_str) {
- error = atoi(resp_str);
- if (error) {
- result = TEL_CALL_RESULT_FAILURE;
- goto OUT;
- } else {
- result = TEL_CALL_RESULT_SUCCESS;
- }
+ if (!(resp_str = g_slist_nth_data(tokens, 1))) {
+ err("xdrv_result missing");
+ goto OUT;
+ }
+ error = atoi(resp_str);
+ if (!error) {
+ err(" RESPONSE NOK [%d]", error);
+ goto OUT;
}
+ result = TEL_CALL_RESULT_SUCCESS;
}
OUT :
* instead of his own vconfkey. (0 : By network, 1 : Show, 2 : Hide)
*/
vconf_get_int("db/ciss/show_my_number", &cli);
- if(cli == 2){
+ if (cli == 2){
dbg("clir invocation from setting application");
clir = "I";
} else {
}
/*
- * Operation - release all calls/release specific call/release all active call/release all held calls.
+ * Operation - release all calls/release specific call/release all active
+ * call/release all held calls.
*
* Request -
* 1. AT-Command: AT+CHLD=[<n>]
* <n>
- * 0 - (defualt)release all held calls or set User Determined User Busy for a waiting/incoming.
+ * 0 - (defualt)release all held calls or set User Determined User -
+ * Busy for a waiting/incoming.
* call; if both exists then only the waiting call will be rejected.
* 1 - release all active calls and accepts the other (held or waiting).
* 1x - release a specific call (x specific call number as indicated by call id).
dbg("entry");
//(void) _set_dtmf_tone_duration(o, dup);
- tmp_dtmf = tcore_malloc0((strlen(dtmf_str) * 2) + 1); // DTMF digits + comma for each dtmf digit.
+
+ /* DTMF digits + comma for each dtmf digit */
+ tmp_dtmf = tcore_malloc0((strlen(dtmf_str) * 2) + 1);
tcore_check_return_value_assert(tmp_dtmf != NULL, TEL_RETURN_FAILURE);
/* Save initial pointer */
dtmf = tmp_dtmf;
tmp_dtmf++;
}
- // last digit is having COMMA , overwrite it with '\0' .
+ /* last digit is having COMMA , overwrite it with '\0'*/
*(--tmp_dtmf) = '\0';
- // AT+VTS = <d1>,<d2>,<d3>,<d4>,<d5>,<d6>, ..... <d32>
+ /* (AT+VTS = <d1>,<d2>,<d3>,<d4>,<d5>,<d6>, ..... <d32> */
at_cmd = g_strdup_printf("AT+VTS=%s", dtmf);
dbg("at command : %s", at_cmd);
}
/*
- * Operation - call transfer.
+ * Operation - call deflect.
*
* Request -
* 1. AT-Command: AT+CTFR= <number>[,<type>]