Fix and place modem plugin in modems folder
authorPhilippe Nunes <philippe.nunes@linux.intel.com>
Thu, 14 Mar 2013 08:05:14 +0000 (09:05 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 07:46:41 +0000 (16:46 +0900)
Change-Id: Id8acf975a48865a8d355dd269d63941a2f5e4ca1

CMakeLists.txt
packaging/tel-plugin-imc.spec
src/desc.c
src/s_modem.c

index 944fc3b..c7cf7b8 100644 (file)
@@ -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)
index 8844a3c..f5ac6e2 100755 (executable)
@@ -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
index dc21ee3..52181b1 100644 (file)
@@ -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);
index 6d21f86..81bdec1 100644 (file)
@@ -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;
        }