From 91cc586a98585d9099881660aa7a50012f25b386 Mon Sep 17 00:00:00 2001 From: Philippe Nunes Date: Thu, 14 Mar 2013 09:05:14 +0100 Subject: [PATCH] Fix and place modem plugin in modems folder Change-Id: Id8acf975a48865a8d355dd269d63941a2f5e4ca1 --- CMakeLists.txt | 2 +- packaging/tel-plugin-imc.spec | 2 +- src/desc.c | 11 ++++++----- src/s_modem.c | 16 +++++++++++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 944fc3b..c7cf7b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ SET_TARGET_PROPERTIES(imc-plugin PROPERTIES PREFIX "" OUTPUT_NAME imc-plugin) # install INSTALL(TARGETS imc-plugin - LIBRARY DESTINATION lib/telephony/plugins) + LIBRARY DESTINATION lib/telephony/plugins/modems) INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/wiki_mcc_mnc_oper_list.sql DESTINATION /tmp RENAME mcc_mnc_oper_list.sql) INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME tel-plugin-imc) diff --git a/packaging/tel-plugin-imc.spec b/packaging/tel-plugin-imc.spec index 8844a3c..f5ac6e2 100755 --- a/packaging/tel-plugin-imc.spec +++ b/packaging/tel-plugin-imc.spec @@ -56,6 +56,6 @@ mkdir -p %{buildroot}/usr/share/license %defattr(-,root,root,-) -%{_libdir}/telephony/plugins/* +%{_libdir}/telephony/plugins/modems/* /tmp/mcc_mnc_oper_list.sql /usr/share/license/tel-plugin-imc diff --git a/src/desc.c b/src/desc.c index dc21ee3..52181b1 100644 --- a/src/desc.c +++ b/src/desc.c @@ -52,7 +52,7 @@ static void on_confirmation_modem_message_send(TcorePending *p, gboolean result, void *user_data) { - dbg("on_confirmation_modem_message_send - msg out from queue."); + dbg("msg out from queue"); dbg("%s", result == FALSE ? "SEND FAIL" : "SEND OK"); } @@ -62,12 +62,13 @@ static void on_response_bootup_subscription(TcorePending *p, int data_len, const TcorePlugin *plugin = user_data; const TcoreATResponse *resp = data; - dbg("entry of on_response_bootup_subscription() - response comes\n"); + dbg("Entry"); - if (resp->success) + if (resp->success > 0) { dbg("result OK"); - - dbg("result ERROR"); + } else { + dbg("result ERROR"); + } if (plugin != NULL) modem_power_on(plugin); diff --git a/src/s_modem.c b/src/s_modem.c index 6d21f86..81bdec1 100644 --- a/src/s_modem.c +++ b/src/s_modem.c @@ -100,8 +100,7 @@ typedef struct { static void prepare_and_send_pending_request(CoreObject *co, const char *at_cmd, const char *prefix, enum tcore_at_command_type at_cmd_type, TcorePendingResponseCallback callback); static void on_confirmation_modem_message_send(TcorePending *p, gboolean result, void *user_data); // from Kernel -void on_response_bootup_subscription(TcorePending *p, int data_len, const void *data, void *user_data); -void on_response_last_bootup_subscription(TcorePending *p, int data_len, const void *data, void *user_data); +static void on_response_network_registration(TcorePending *p, int data_len, const void *data, void *user_data); static void on_response_enable_proactive_command(TcorePending *p, int data_len, const void *data, void *user_data); static void on_confirmation_modem_message_send(TcorePending *p, gboolean result, void *user_data) @@ -127,6 +126,17 @@ static void on_response_enable_proactive_command(TcorePending *p, int data_len, } } +static void on_response_network_registration(TcorePending *p, int data_len, const void *data, void *user_data) +{ + const TcoreATResponse *resp = data; + + if (resp->success > 0) { + dbg("registration attempt OK"); + } else { + dbg("registration attempt failed"); + } +} + void prepare_and_send_pending_request(CoreObject *co, const char *at_cmd, const char *prefix, enum tcore_at_command_type at_cmd_type, TcorePendingResponseCallback callback) { TcoreATRequest *req = NULL; @@ -407,7 +417,7 @@ static gboolean on_event_bootup_sim_status(CoreObject *o, const void *event_info dbg("SIM ready. request COPS & remove callback"); dbg("power on done set for proactive command receiving mode"); prepare_and_send_pending_request(o, "AT+CFUN=6", NULL, TCORE_AT_NO_RESULT, on_response_enable_proactive_command); - prepare_and_send_pending_request(o, "AT+COPS=0", NULL, TCORE_AT_NO_RESULT, on_response_bootup_subscription); + prepare_and_send_pending_request(o, "AT+COPS=0", NULL, TCORE_AT_NO_RESULT, on_response_network_registration); return FALSE; } -- 2.7.4