}
dbg("noti.str - %s", noti.str);
- core_obj = tcore_plugin_ref_core_object(p, "ss");
+ core_obj = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS);
tcore_server_send_notification(tcore_plugin_ref_server(p),
core_obj,
TNOTI_SS_USSD,
if (str) {
memset(str, 0x00, strlen(ussd_string) - 1);
} else {
- dbg("malloc failed")
+ dbg("malloc failed");
if (NULL != tokens) {
tcore_at_tok_free(tokens);
}
_ss_ussd_response(ur, ussd_str, type, status);
}
-
-CATCH:
+
+CATCH:
if (NULL != tokens) {
tcore_at_tok_free(tokens);
}
-
+
if (NULL != str) {
free(str);
}
dbg("function enter");
plugin = tcore_object_ref_plugin(o);
- co = tcore_plugin_ref_core_object(plugin, "call");
+ co = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
if (!co) {
dbg("[ error ] plugin_ref_core_object : call");
return FALSE;
tcore_at_tok_free(tokens);
}
- if (NULL != number) {
- g_free(number);
- }
+ g_free(number);
return TRUE;
}
CoreObject *o = 0;
UserRequest *ur = 0, *dup_ur = 0;
struct ss_confirm_info *info = 0;
- struct tresp_ss_forwarding resp;
+ struct tresp_ss_forwarding resp = {0,};
GSList *tokens = NULL;
const char *line;
- int err;
+ int error;
const TcoreATResponse *response;
dbg("function enter");
if (response->success > 0) {
dbg("RESPONSE OK");
resp.err = SS_ERROR_NONE;
- resp.record = 0;
} else {
dbg("RESPONSE NOT OK");
- resp.record = 0;
+
+ /* Extract Error */
line = (const char *) response->final_response;
tokens = tcore_at_tok_new(line);
if (g_slist_length(tokens) < 1) {
- dbg("err cause not specified or string corrupted");
+ dbg("Error cause not specified or string corrupted");
resp.err = SS_ERROR_SYSTEMFAILURE;
} else {
- err = atoi(g_slist_nth_data(tokens, 0));
+ error = atoi(g_slist_nth_data(tokens, 0));
+ err("Error: [%d]", error);
// / TODO: CMEE error mapping is required.
resp.err = SS_ERROR_SYSTEMFAILURE;
}
UserRequest *ur = 0;
UserRequest *ur_dup = 0;
struct ss_confirm_info *info = 0;
- struct tresp_ss_waiting resp;
+ struct tresp_ss_waiting resp = {0,};
GSList *tokens = NULL;
const char *line;
int err;
core_obj = tcore_pending_ref_core_object(p);
ur = tcore_pending_ref_user_request(p);
- info = (struct ss_confirm_info *) user_data;
+ info = (struct ss_confirm_info *)user_data;
if (response->success > 0) {
dbg("RESPONSE OK");
resp.err = SS_ERROR_NONE;
- resp.record = 0;
} else {
dbg("RESPONSE NOT OK");
- resp.record = 0;
+
+ /* Extract Error */
line = (const char *) response->final_response;
tokens = tcore_at_tok_new(line);
if (g_slist_length(tokens) < 1) {
- dbg("err cause not specified or string corrupted");
+ dbg("Error cause not specified or string corrupted");
resp.err = SS_ERROR_SYSTEMFAILURE;
} else {
err = atoi(g_slist_nth_data(tokens, 0));
- // / TODO: CMEE error mapping is required.
+
+ /* TODO: CMEE error mapping is required. */
resp.err = SS_ERROR_SYSTEMFAILURE;
}
+
+ /* Free tokens */
tcore_at_tok_free(tokens);
}
- dbg("on_response_ss_waiting_set - rsp.err : %d, ur : %x, class : %d", resp.err, ur, info->class);
-
+ dbg("Call Waiting - Error: [%d], UR: [0x%x] class: [0x%2x]", resp.err, ur, info->class);
if (resp.err == SS_ERROR_NONE) {
ur_dup = tcore_user_request_ref(ur);
- dbg("Get waiting call status");
+
+ dbg("Get Call Waiting status");
_ss_waiting_get(core_obj, ur_dup, info->class, info->resp);
} else {
if (ur) {
tcore_user_request_send_response(ur, info->resp, sizeof(struct tresp_ss_waiting), &resp);
} else {
- dbg("[ error ] ur is 0");
+ err("User request is NULL");
}
}
g_free(user_data);
dbg("total records : %d", countRecords);
} else {
countRecords = 0;
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
resp.record_num = countRecords;
resp.record = 0;
resp.record_num = countValidRecords;
resp.err = SS_ERROR_NONE;
} else {
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
if (response->success > 0) {
dbg("total records : %d", countRecords);
} else {
countRecords = 0;
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
resp.record_num = countRecords;
resp.record = 0;
resp.record_num = countValidRecords;
resp.err = SS_ERROR_NONE;
} else {
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
if (response->success > 0) {
char *classx_str, *status;
const TcoreATResponse *response;
- dbg("function enter")
+ dbg("function enter");
response = data;
ur = tcore_pending_ref_user_request(p);
info = (struct ss_confirm_info *) user_data;
dbg("total records : %d", countRecords);
} else {
countRecords = 0;
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
resp.record_num = countRecords;
resp.record = 0;
resp.record_num = countValidRecords;
resp.err = SS_ERROR_NONE;
} else {
- dbg("no active status - return to user")
+ dbg("no active status - return to user");
}
if (response->success > 0) {
GSList *tokens = NULL;
const TcoreATResponse *response;
- dbg("function enter")
+ dbg("function enter");
response = data;
ur = tcore_pending_ref_user_request(p);
p_type = (enum telephony_ss_cli_type *) (user_data);
if (*p_type == SS_CLI_TYPE_CLIR) {
// +CLIR: <n> <m>
- dbg("CLI type is CLIR")
+ dbg("CLI type is CLIR");
// parse <n>
status = g_slist_nth_data(tokens, 0);
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
ret = _ss_request_message(pending, o, ur, on_response_ss_barring_change_pwd, user_data);
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
ret = _ss_request_message(pending, o, ur, on_response_ss_waiting_set, user_data);
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
TcorePending *pending = NULL;
TcoreATRequest *req;
- dbg("function enter")
+ dbg("function enter");
switch (class) {
case SS_CLASS_ALL_TELE:
classx = 7;
ret = _ss_request_message(pending, o, ur, on_response_ss_waiting_get, user_data);
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
ret = _ss_request_message(pending, o, ur, on_response_ss_cli_get, user_data);
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
g_free(cmd_str);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
if (user_data != NULL) {
g_free(user_data);
}
ret = _ss_request_message(pending, o, ur, (TcorePendingResponseCallback) cb, user_data);
if (!ret) {
- dbg("AT request sent failed ")
+ dbg("AT request sent failed ");
return TCORE_RETURN_FAILURE;
}
return TCORE_RETURN_SUCCESS;
return ret;
}
-gboolean s_ss_init(TcorePlugin *p, TcoreHal *h)
+gboolean s_ss_init(TcorePlugin *cp, CoreObject *co_ss)
{
- CoreObject *so = 0, *co = 0;
- struct property_call_info *data = 0;
+ CoreObject *co_call = NULL;
- so = tcore_ss_new(p, "ss", &ss_ops, h);
- if (!so) {
- dbg("[ error ] ss_new()");
- return FALSE;
- }
+ tcore_ss_override_ops(co_ss, &ss_ops);
- co = tcore_plugin_ref_core_object(p, "call");
- if (!co) {
- dbg("[ error ] plugin_ref_core_object");
+
+ co_call = tcore_plugin_ref_core_object(cp,
+ CORE_OBJECT_TYPE_CALL);
+ if (co_call == NULL) {
+ err("Can't find CALL core object");
return FALSE;
}
- tcore_call_control_set_operations(co, &call_ops);
-
- tcore_object_add_callback(so, "+CSSU", on_notification_ss_info, 0);
- tcore_object_add_callback(so, "+CSSI", on_notification_ss_info, 0);
- tcore_object_add_callback(so, "+CUSD", on_notification_ss_ussd, 0);
+ tcore_call_override_ops(co_call, NULL, &call_ops);
- data = calloc(sizeof(struct property_call_info *), 1);
- tcore_plugin_link_property(p, "SS", data);
+ tcore_object_override_callback(co_ss, "+CSSU", on_notification_ss_info, NULL);
+ tcore_object_override_callback(co_ss, "+CSSI", on_notification_ss_info, NULL);
+ tcore_object_override_callback(co_ss, "+CUSD", on_notification_ss_ussd, NULL);
return TRUE;
}
-void s_ss_exit(TcorePlugin *p)
+void s_ss_exit(TcorePlugin *cp, CoreObject *co_ss)
{
- CoreObject *o;
- struct property_network_info *data;
-
- o = tcore_plugin_ref_core_object(p, "ss");
-
- data = tcore_plugin_ref_property(p, "SS");
- if (data)
- free(data);
-
- tcore_ss_free(o);
+ dbg("Exit");
}