From 137c04e08296dfc4710eb38d8f66a39d8ff42ff4 Mon Sep 17 00:00:00 2001 From: xujianhang Date: Mon, 11 Nov 2024 10:03:19 +0800 Subject: [PATCH] optimize tapi debug log --- src/tapi_call.c | 107 +++++++++++++++++++++++------------- src/tapi_cbs.c | 10 ++-- src/tapi_data.c | 58 ++++++++++---------- src/tapi_ims.c | 16 +++--- src/tapi_manager.c | 132 ++++++++++++++++++++++----------------------- src/tapi_network.c | 56 +++++++++++-------- src/tapi_ss.c | 5 +- 7 files changed, 214 insertions(+), 170 deletions(-) diff --git a/src/tapi_call.c b/src/tapi_call.c index 759a92d..8bb444e 100644 --- a/src/tapi_call.c +++ b/src/tapi_call.c @@ -76,7 +76,18 @@ static int tapi_call_property_change(DBusMessage* message, tapi_async_handler* h static int call_strcpy(char* dst, const char* src, int dst_size) { - if (dst == NULL || src == NULL || strlen(src) > dst_size) { + if (dst == NULL) { + tapi_log_error("dst in %s is null", __func__); + return -EINVAL; + } + + if (src == NULL) { + tapi_log_error("src in %s is null", __func__); + return -EINVAL; + } + + if (strlen(src) > dst_size) { + tapi_log_error("src length is too long"); return -EINVAL; } @@ -100,8 +111,18 @@ static void call_param_append(DBusMessageIter* iter, void* user_data) call_param* param; char* number; - if (handler == NULL || handler->result == NULL || handler->result->data == NULL) { - tapi_log_error("invalid dial request argument !!"); + if (handler == NULL) { + tapi_log_error("handler in %s is null", __func__); + return; + } + + if (handler->result == NULL) { + tapi_log_error("result in %s is null", __func__); + return; + } + + if (handler->result->data == NULL) { + tapi_log_error("data in %s is null", __func__); return; } @@ -131,7 +152,7 @@ static void answer_hangup_param_append(DBusMessageIter* iter, void* user_data) char* path = user_data; if (path == NULL) { - tapi_log_error("invalid answer_hangup request argument !!"); + tapi_log_error("invalid answer_hangup request argument in %s!!", __func__); return; } @@ -145,8 +166,18 @@ static void dtmf_param_append(DBusMessageIter* iter, void* user_data) unsigned char digit; int flag; - if (handler == NULL || handler->result == NULL || handler->result->data == NULL) { - tapi_log_error("invalid dtmf request argument !!"); + if (handler == NULL) { + tapi_log_error("handler in %s is null", __func__); + return; + } + + if (handler->result == NULL) { + tapi_log_error("result in %s is null", __func__); + return; + } + + if (handler->result->data == NULL) { + tapi_log_error("data in %s is null", __func__); return; } @@ -167,7 +198,7 @@ static void deflect_param_append_0(DBusMessageIter* iter, void* user_data) char *path, *number; if (param == NULL) { - tapi_log_error("invalid deflect request argument !!"); + tapi_log_error("param in %s is null", __func__); return; } @@ -203,7 +234,7 @@ static void conference_param_append(DBusMessageIter* iter, void* user_data) ims_conference_participants = user_data; if (ims_conference_participants == NULL) { - tapi_log_error("invalid conference request argument !!"); + tapi_log_error("ims_conference_participants in %s is null", __func__); return; } @@ -244,7 +275,7 @@ static int tapi_call_default_voicecall_slot_change(DBusMessage* message, tapi_as } if (!dbus_message_iter_init(message, &iter)) { - tapi_log_error("dbus message iter init failed"); + tapi_log_error("dbus message iter init failed in %s", __func__); return false; } @@ -287,7 +318,6 @@ static int ring_back_tone_change(DBusMessage* message, tapi_async_handler* handl if (is_call_signal_message(message, &iter, DBUS_TYPE_INT32)) { dbus_message_iter_get_basic(&iter, &ar->arg2); - ar->status = OK; cb(ar); } @@ -356,7 +386,7 @@ static int call_state_changed(DBusConnection* connection, DBusMessage* message, } if (!dbus_message_iter_init(message, &iter)) { - tapi_log_error("dbus message iter init failed"); + tapi_log_error("dbus message iter init failed in %s", __func__); return 0; } @@ -398,14 +428,14 @@ static void dial_call_callback(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; } if (dbus_message_iter_init(message, &iter) == false) { - tapi_log_error("dbus message iter init failed"); + tapi_log_error("dbus message iter init failed in %s", __func__); ar->status = ERROR; goto done; } @@ -447,7 +477,7 @@ static void play_dtmf_callback(DBusMessage* message, void* user_data) ar->status = OK; dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; } @@ -484,20 +514,20 @@ static void merge_call_complete(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; } if (dbus_message_has_signature(message, "ao") == false) { - tapi_log_error("dbus message has wrong signature"); + tapi_log_error("dbus message has wrong signature in %s", __func__); ar->status = ERROR; goto done; } if (dbus_message_iter_init(message, &iter) == false) { - tapi_log_error("dbus message iter init failed"); + tapi_log_error("dbus message iter init failed in %s", __func__); ar->status = ERROR; goto done; } @@ -550,18 +580,18 @@ static void call_list_query_complete(DBusMessage* message, void* user_data) // start to handle response message. dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); goto done; } if (dbus_message_has_signature(message, "a(oa{sv})") == false) { - tapi_log_error("dbus message has wrong signature"); + tapi_log_error("dbus message has wrong signature in %s", __func__); goto done; } if (dbus_message_iter_init(message, &args) == false) { - tapi_log_error("dbus message iter init failed"); + tapi_log_error("dbus message iter init failed in %s", __func__); goto done; } @@ -758,13 +788,13 @@ static int tapi_register_manager_call_signal(tapi_context context, int slot_id, member = get_call_signal_member(msg); if (member == NULL) { - tapi_log_error("no signal member found ...\n"); + tapi_log_error("member in %s is null", __func__); return -EINVAL; } modem_path = tapi_utils_get_modem_path(slot_id); if (modem_path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("modem_path in %s is null", __func__); return -EIO; } @@ -866,11 +896,12 @@ static int manage_call_proxy_method(tapi_context context, int slot_id, const cha proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } if (!g_dbus_proxy_method_call(proxy, member, NULL, no_operate_callback, NULL, NULL)) { + tapi_log_error("dbus method call fail in %s", __func__); report_data_logging_for_call_if(!strcmp("HangupAll", member), ctx, OFONO_CALL_TYPE_UNKNOW, OFONO_DIRECTION_UNKNOW, OFONO_VOICE, OFONO_HANGUP_FAIL, "dbus method call fail"); report_data_logging_for_call_if(!strcmp("ReleaseAndAnswer", member) @@ -911,7 +942,7 @@ static int manager_conference(tapi_context context, int slot_id, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -953,7 +984,7 @@ static int call_play_dtmf(tapi_context context, int slot_id, unsigned char digit proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1025,7 +1056,7 @@ int tapi_call_dial(tapi_context context, int slot_id, char* number, int hide_cal proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1169,7 +1200,7 @@ int tapi_call_get_all_calls(tapi_context context, int slot_id, int event_id, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1224,7 +1255,7 @@ int tapi_call_merge_call(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1283,7 +1314,7 @@ int tapi_call_separate_call(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1337,7 +1368,7 @@ int tapi_call_send_tones(void* context, int slot_id, char* tones) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1374,7 +1405,7 @@ int tapi_call_get_ecc_list(tapi_context context, int slot_id, ecc_info* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1382,7 +1413,7 @@ int tapi_call_get_ecc_list(tapi_context context, int slot_id, ecc_info* out) syslog(LOG_DEBUG, "no EmergencyNumbers in CALL,use default"); proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } if (!g_dbus_proxy_get_property(proxy, "EmergencyNumbers", &list)) { @@ -1567,7 +1598,7 @@ int tapi_call_register_call_state_change(tapi_context context, int slot_id, modem_path = tapi_utils_get_modem_path(slot_id); if (modem_path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("no available modem in %s", __func__); return -EIO; } @@ -1626,7 +1657,7 @@ int tapi_call_answer_by_id(tapi_context context, int slot_id, char* call_id) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1663,7 +1694,7 @@ int tapi_call_hangup_by_id(tapi_context context, int slot_id, char* call_id) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1706,7 +1737,7 @@ int tapi_call_deflect_by_id(tapi_context context, int slot_id, char* call_id, ch proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1749,7 +1780,7 @@ int tapi_call_set_default_slot(tapi_context context, int slot_id) proxy = ctx->dbus_proxy_manager; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1783,7 +1814,7 @@ int tapi_call_get_default_slot(tapi_context context, int* out) proxy = ctx->dbus_proxy_manager; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } diff --git a/src/tapi_cbs.c b/src/tapi_cbs.c index 8310218..c85d2aa 100644 --- a/src/tapi_cbs.c +++ b/src/tapi_cbs.c @@ -173,7 +173,7 @@ int tapi_sms_set_cell_broadcast_power_on(tapi_context context, int slot_id, bool proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CBS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -203,7 +203,7 @@ int tapi_sms_get_cell_broadcast_power_on(tapi_context context, int slot_id, bool proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CBS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EISCONN; } @@ -238,7 +238,7 @@ int tapi_sms_set_cell_broadcast_topics(tapi_context context, int slot_id, char* proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CBS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -268,7 +268,7 @@ int tapi_sms_get_cell_broadcast_topics(tapi_context context, int slot_id, char** proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CBS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EISCONN; } @@ -302,7 +302,7 @@ int tapi_cbs_register(tapi_context context, int slot_id, tapi_indication_msg msg path = tapi_utils_get_modem_path(slot_id); if (path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("no available modem in %s", __func__); return -EIO; } diff --git a/src/tapi_data.c b/src/tapi_data.c index d7e6304..bb59dc6 100644 --- a/src/tapi_data.c +++ b/src/tapi_data.c @@ -478,7 +478,7 @@ static void apn_list_loaded(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; @@ -558,7 +558,7 @@ static void apn_list_changed(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; } @@ -587,7 +587,7 @@ static void apn_context_append(DBusMessageIter* iter, void* user_data) dc = ar->data; if (dc == NULL) { - tapi_log_error("invalid apn settings ... \n"); + tapi_log_error("dc in %s is null", __func__); return; } @@ -668,7 +668,7 @@ static void apn_context_edit(DBusMessageIter* iter, void* user_data) dc = ar->data; if (dc == NULL) { - tapi_log_error("invalid apn settings ... \n"); + tapi_log_error("dc in %s is null", __func__); return; } @@ -734,7 +734,7 @@ static void data_connection_list_query_done(DBusMessage* message, void* user_dat dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; @@ -837,7 +837,7 @@ int tapi_data_load_apn_contexts(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -893,13 +893,13 @@ int tapi_data_add_apn_context(tapi_context context, } if (tapi_utils_apn_type_to_string(apn->type) == NULL) { - tapi_log_error("invalid apn argument ...\n"); + tapi_log_error("invalid apn argument in %s", __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -957,7 +957,7 @@ int tapi_data_remove_apn_context(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1014,13 +1014,13 @@ int tapi_data_edit_apn_context(tapi_context context, } if (tapi_utils_apn_type_to_string(apn->type) == NULL) { - tapi_log_error("invalid apn argument ...\n"); + tapi_log_error("invalid apn argument in %s", __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1073,7 +1073,7 @@ int tapi_data_reset_apn_contexts(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1129,7 +1129,7 @@ int tapi_data_is_registered(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1169,7 +1169,7 @@ int tapi_data_is_data_emergency_only(tapi_context context, int slot_id, bool* ou proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1212,7 +1212,7 @@ int tapi_data_get_network_type(tapi_context context, int slot_id, tapi_network_t proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1251,7 +1251,7 @@ int tapi_data_is_data_roaming(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1288,7 +1288,7 @@ int tapi_data_request_network(tapi_context context, int slot_id, const char* typ proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1323,7 +1323,7 @@ int tapi_data_release_network(tapi_context context, int slot_id, const char* typ proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1356,7 +1356,7 @@ int tapi_data_get_data_connection_list(tapi_context context, int slot_id, int ev proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1416,7 +1416,7 @@ int tapi_data_set_preferred_apn(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1453,7 +1453,7 @@ int tapi_data_get_preferred_apn(tapi_context context, int slot_id, char** out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1487,7 +1487,7 @@ int tapi_data_enable_data(tapi_context context, bool enabled) for (int i = 0; i < CONFIG_MODEM_ACTIVE_COUNT; i++) { proxy = ctx->dbus_proxy[i][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1520,7 +1520,7 @@ int tapi_data_get_enabled(tapi_context context, bool* out) proxy = ctx->dbus_proxy[DEFAULT_SLOT_ID][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1556,7 +1556,7 @@ int tapi_data_enable_roaming(tapi_context context, bool enabled) for (int i = 0; i < CONFIG_MODEM_ACTIVE_COUNT; i++) { proxy = ctx->dbus_proxy[i][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1589,7 +1589,7 @@ int tapi_data_get_roaming_enabled(tapi_context context, bool* out) proxy = ctx->dbus_proxy[DEFAULT_SLOT_ID][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1612,7 +1612,7 @@ int tapi_data_set_default_slot(tapi_context context, int slot_id) proxy = ctx->dbus_proxy_manager; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1645,7 +1645,7 @@ int tapi_data_get_default_slot(tapi_context context, int* out) proxy = ctx->dbus_proxy_manager; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1690,7 +1690,7 @@ int tapi_data_set_data_allow(tapi_context context, int slot_id, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_DATA]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1747,7 +1747,7 @@ int tapi_data_register(tapi_context context, modem_path = tapi_utils_get_modem_path(slot_id); if (modem_path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("no available modem in %s", __func__); return -EIO; } diff --git a/src/tapi_ims.c b/src/tapi_ims.c index 7def7bc..d0434f2 100644 --- a/src/tapi_ims.c +++ b/src/tapi_ims.c @@ -67,7 +67,7 @@ static int tapi_ims_enable(tapi_context context, int slot_id, int state) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -184,7 +184,7 @@ int tapi_ims_set_service_status(tapi_context context, int slot_id, int capabilit proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -218,7 +218,7 @@ int tapi_ims_register_registration_change(tapi_context context, int slot_id, voi path = tapi_utils_get_modem_path(slot_id); if (path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("no available modem in %s", __func__); return -EIO; } @@ -287,7 +287,7 @@ int tapi_ims_get_registration(tapi_context context, int slot_id, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -338,7 +338,7 @@ int tapi_ims_is_registered(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -377,7 +377,7 @@ int tapi_ims_is_volte_available(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -422,7 +422,7 @@ int tapi_ims_get_subscriber_uri_number(tapi_context context, int slot_id, char** proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -459,7 +459,7 @@ int tapi_ims_get_enabled(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_IMS]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } diff --git a/src/tapi_manager.c b/src/tapi_manager.c index d308115..6114756 100644 --- a/src/tapi_manager.c +++ b/src/tapi_manager.c @@ -1065,7 +1065,7 @@ static int tapi_modem_register(tapi_context context, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -1360,18 +1360,18 @@ int tapi_set_pref_net_mode(tapi_context context, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_RADIO]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1419,18 +1419,18 @@ int tapi_get_pref_net_mode(tapi_context context, int slot_id, tapi_pref_net_mode } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_RADIO]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1457,18 +1457,18 @@ int tapi_send_modem_power(tapi_context context, int slot_id, bool state) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1493,18 +1493,18 @@ int tapi_get_imei(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1529,18 +1529,18 @@ int tapi_get_imeisv(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1565,18 +1565,18 @@ int tapi_get_modem_manufacturer(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1601,18 +1601,18 @@ int tapi_get_modem_model(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1637,18 +1637,18 @@ int tapi_get_modem_revision(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1674,18 +1674,18 @@ int tapi_get_phone_state(tapi_context context, int slot_id, tapi_phone_state* st } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_CALL]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1714,18 +1714,18 @@ int tapi_set_radio_power(tapi_context context, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1770,18 +1770,18 @@ int tapi_get_radio_power(tapi_context context, int slot_id, bool* out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1809,18 +1809,18 @@ int tapi_get_radio_state(tapi_context context, int slot_id, tapi_radio_state* ou } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1846,18 +1846,18 @@ int tapi_get_msisdn_number(tapi_context context, int slot_id, char** out) } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } if (!ctx->client_ready) { - tapi_log_error("dbus client is not ready"); + tapi_log_error("dbus client is not ready in %s", __func__); return -EAGAIN; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_SIM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1896,13 +1896,13 @@ int tapi_get_modem_activity_info(tapi_context context, int slot_id, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1950,7 +1950,7 @@ int tapi_invoke_oem_ril_request_raw(tapi_context context, int slot_id, int event } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -1966,7 +1966,7 @@ int tapi_invoke_oem_ril_request_raw(tapi_context context, int slot_id, int event proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2025,7 +2025,7 @@ int tapi_invoke_oem_ril_request_strings(tapi_context context, int slot_id, int e } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2041,7 +2041,7 @@ int tapi_invoke_oem_ril_request_strings(tapi_context context, int slot_id, int e proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2099,13 +2099,13 @@ int tapi_enable_modem(tapi_context context, int slot_id, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2152,13 +2152,13 @@ int tapi_enable_modem_abnormal_event(tapi_context context, int slot_id, bool ena } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2219,13 +2219,13 @@ int tapi_get_modem_status(tapi_context context, int slot_id, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2270,7 +2270,7 @@ int tapi_get_modem_status_sync(tapi_context context, int slot_id, tapi_modem_sta } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2281,7 +2281,7 @@ int tapi_get_modem_status_sync(tapi_context context, int slot_id, tapi_modem_sta proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2351,7 +2351,7 @@ static int tapi_manager_register_data_loging(tapi_context context, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2397,7 +2397,7 @@ static int trigger_modem_load_ecc_list(tapi_context context, int slot_id) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2512,13 +2512,13 @@ int tapi_handle_command(tapi_context context, int slot_id, int atom, int command } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2564,7 +2564,7 @@ int tapi_set_fast_dormancy(tapi_context context, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2575,7 +2575,7 @@ int tapi_set_fast_dormancy(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_RADIO]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2641,7 +2641,7 @@ int tapi_get_carrier_config_bool(tapi_context context, int slot_id, char* key, b } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2657,7 +2657,7 @@ int tapi_get_carrier_config_bool(tapi_context context, int slot_id, char* key, b proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2711,7 +2711,7 @@ int tapi_get_carrier_config_int(tapi_context context, int slot_id, char* key, in } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2727,7 +2727,7 @@ int tapi_get_carrier_config_int(tapi_context context, int slot_id, char* key, in proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -2780,7 +2780,7 @@ int tapi_get_carrier_config_string(tapi_context context, int slot_id, char* key, } if (!tapi_is_valid_slotid(slot_id)) { - tapi_log_error("invalid slot id %d", slot_id); + tapi_log_error("invalid slot id %d in %s", slot_id, __func__); return -EINVAL; } @@ -2796,7 +2796,7 @@ int tapi_get_carrier_config_string(tapi_context context, int slot_id, char* key, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_MODEM]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } diff --git a/src/tapi_network.c b/src/tapi_network.c index 3c1a682..9b65d81 100644 --- a/src/tapi_network.c +++ b/src/tapi_network.c @@ -35,8 +35,15 @@ static void parse_nitz(const char* str, tapi_network_time* info) char* pch; char* orig; - if (str == NULL || info == NULL) + if (str == NULL) { + tapi_log_error("str in %s is null", __func__); return; + } + + if (info == NULL) { + tapi_log_error("info in %s is null", __func__); + return; + } p = &info->sec; orig = strdup(str); @@ -60,8 +67,13 @@ static void register_param_append(DBusMessageIter* iter, void* user_data) tapi_operator_info* network_info; char *mcc, *mnc, *tech; - if (handler == NULL || handler->result == NULL) { - tapi_log_error("invalid network register argument !!"); + if (handler == NULL) { + tapi_log_error("handler in %s is null", __func__); + return; + } + + if (handler->result == NULL) { + tapi_log_error("async result in %s is null", __func__); return; } @@ -569,7 +581,7 @@ static void network_register_cb(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; } @@ -615,7 +627,7 @@ static void cell_list_request_complete(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; @@ -710,7 +722,7 @@ static void registration_info_query_done(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; @@ -815,7 +827,7 @@ static void operator_scan_complete(DBusMessage* message, void* user_data) dbus_error_init(&err); if (dbus_set_error_from_message(&err, message) == true) { - tapi_log_error("%s: %s\n", err.name, err.message); + tapi_log_error("error from message in %s, %s: %s", __func__, err.name, err.message); dbus_error_free(&err); ar->status = ERROR; goto done; @@ -922,7 +934,7 @@ int tapi_network_select_auto(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -979,7 +991,7 @@ int tapi_network_select_manual(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1038,7 +1050,7 @@ int tapi_network_scan(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1090,7 +1102,7 @@ int tapi_network_get_serving_cellinfos(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETMON]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1142,7 +1154,7 @@ int tapi_network_get_neighbouring_cellinfos(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETMON]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1242,7 +1254,7 @@ int tapi_network_is_voice_emergency_only(tapi_context context, int slot_id, bool proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1286,7 +1298,7 @@ int tapi_network_get_voice_network_type(tapi_context context, int slot_id, tapi_ proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1326,7 +1338,7 @@ int tapi_network_is_voice_roaming(tapi_context context, int slot_id, bool* out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1365,7 +1377,7 @@ int tapi_network_get_mcc(tapi_context context, int slot_id, char** mcc) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1401,7 +1413,7 @@ int tapi_network_get_mnc(tapi_context context, int slot_id, char** mnc) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1437,7 +1449,7 @@ int tapi_network_get_display_name(tapi_context context, int slot_id, char** out) proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1473,7 +1485,7 @@ int tapi_network_get_signalstrength(tapi_context context, int slot_id, tapi_sign proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1540,7 +1552,7 @@ int tapi_network_get_registration_info(tapi_context context, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETREG]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1593,7 +1605,7 @@ int tapi_network_set_cell_info_list_rate(tapi_context context, int slot_id, proxy = ctx->dbus_proxy[slot_id][DBUS_PROXY_NETMON]; if (proxy == NULL) { - tapi_log_error("no available proxy ...\n"); + tapi_log_error("no available proxy in %s", __func__); return -EIO; } @@ -1653,7 +1665,7 @@ int tapi_network_register(tapi_context context, modem_path = tapi_utils_get_modem_path(slot_id); if (modem_path == NULL) { - tapi_log_error("no available modem ...\n"); + tapi_log_error("no available modem in %s", __func__); return -EIO; } diff --git a/src/tapi_ss.c b/src/tapi_ss.c index f035d06..c94a0ee 100644 --- a/src/tapi_ss.c +++ b/src/tapi_ss.c @@ -966,12 +966,12 @@ static bool is_ussd_signal_message(DBusMessage* message, DBusMessageIter* iter, int msg_type) { if (!dbus_message_iter_init(message, iter)) { - tapi_log_error("ussd_signal message has no param"); + tapi_log_error("message iter init failed in %s", __func__); return false; } if (dbus_message_iter_get_arg_type(iter) != msg_type) { - tapi_log_error("ussd_signal param is not right"); + tapi_log_error("arg type in %s is invalid", __func__); return false; } @@ -2000,6 +2000,7 @@ int tapi_ss_get_call_waiting(tapi_context context, int slot_id, int event_id, ar = malloc(sizeof(tapi_async_result)); if (ar == NULL) { + tapi_log_error("async result in %s is null", __func__); free(handler); return -ENOMEM; }