Update plugin with new design
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Fri, 15 Mar 2013 14:20:05 +0000 (15:20 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 08:10:28 +0000 (17:10 +0900)
src/call.c
src/desc-dbus.c
src/modem.c
src/network.c
src/phonebook.c
src/sat_manager.c
src/sim.c
src/sms.c
src/ss.c

index 60f248ad433d6470ccb334bca37d51d4b6f2a811..8864b2caf905dbd3a3d06de17489a71aca59dc31 100644 (file)
@@ -43,6 +43,7 @@
 #include "generated-code.h"
 #include "common.h"
 
+#define MAX_CALL_STATUS_NUM 7
 
 static void _launch_voice_call( struct tnoti_call_status_incoming* incoming )
 {
@@ -467,8 +468,9 @@ static gboolean on_call_get_status(TelephonyCall *call, GDBusMethodInvocation *i
        gboolean call_direction;
        gint call_status;
        gboolean call_multiparty_state;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        if ( !plugin ) {
                dbg("[ error ] plugin : 0");
                return FALSE;
@@ -524,10 +526,11 @@ static gboolean on_call_get_status_all(TelephonyCall *call, GDBusMethodInvocatio
        gboolean call_direction;
        gint call_status;
        gboolean call_multiparty_state;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        int len, i;
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        if ( !plugin ) {
                dbg("[ error ] plugin : 0");
                return FALSE;
@@ -539,7 +542,6 @@ static gboolean on_call_get_status_all(TelephonyCall *call, GDBusMethodInvocatio
 
        g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
 
-#define MAX_CALL_STATUS_NUM 7
        for ( i=0; i<MAX_CALL_STATUS_NUM; i++ ) {
                list = tcore_call_object_find_by_status( o, i );
 
@@ -917,6 +919,8 @@ gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struc
        telephony_object_skeleton_set_call(object, call);
        g_object_unref(call);
 
+       dbg("call = %p", call);
+
        g_signal_connect (call,
                        "handle-dial",
                        G_CALLBACK (on_call_dial),
index e909ca9095035d731bf4caf55e4f99de4869fed2..83c67371f7079c6a59e7af0db1debb0229d8e58f 100644 (file)
 static void add_modem(struct custom_data *ctx, TcorePlugin *p)
 {
        TelephonyObjectSkeleton *object;
+       CoreObject *co_sim;
        const char *cp_name = tcore_server_get_cp_name_by_plugin(p);
        char *path = NULL;
+       
+       dbg("Entry");
 
-       if (!cp_name)
+       if (cp_name == NULL)
                return;
 
        path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
        dbg("path = [%s]", path);
 
        object = g_hash_table_lookup(ctx->objects, path);
-       if (object) {
-               dbg("dbus interface object already created. (object = %p)", object);
-               goto OUT;
-       }
+       if (object == NULL) {
+               /* Create new DBUS Interface object */
+               object = telephony_object_skeleton_new(path);
+
+               /* Insert the Object to DBUS interfaces HASH Table */
+               dbg("New DBUS Interface object created!!! (object = %p)", object);
+               if (object == NULL)
+                       goto OUT;
+
+               g_hash_table_insert(ctx->objects, g_strdup(path), object);
+       } else
+               dbg("DBUS Interface object already created!!! (object = %p)", object);
 
-       object = telephony_object_skeleton_new(path);
-       dbg("new dbus object created. (object = %p)", object);
-       if (object == NULL)
-               goto OUT;
 
-       g_hash_table_insert(ctx->objects, g_strdup(path), object);
+       /* Add DBUS Interfaces for all Modules supported */
 
-       /* Add interfaces */
+       /* MODEM */
        dbus_plugin_setup_modem_interface(object, ctx);
 
+       /* CALL */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL) != NULL)
                dbus_plugin_setup_call_interface(object, ctx);
 
-
+       /* NETWORK */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK) != NULL)
                dbus_plugin_setup_network_interface(object, ctx);
 
+       /* SS */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS) != NULL)
                dbus_plugin_setup_ss_interface(object, ctx);
 
+       /* SMS */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS) != NULL)
                dbus_plugin_setup_sms_interface(object, ctx);
 
+       /* SIM */
+       co_sim = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SIM);
+       if (co_sim != NULL)
+               dbus_plugin_setup_sim_interface(object, ctx);
 
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAT) != NULL)
-               dbus_plugin_setup_sat_interface(object, ctx);
-
+       /* SAT */
+       if ((co_sim != NULL) && (tcore_sim_get_status(co_sim) >= SIM_STATUS_INITIALIZING))
+               if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAT) != NULL)
+                       dbus_plugin_setup_sat_interface(object, ctx);
 
+       /* PHONEBOOK */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_PHONEBOOK) != NULL)
                dbus_plugin_setup_phonebook_interface(object, ctx);
 
+       /* SAP */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAP) != NULL)
                dbus_plugin_setup_sap_interface(object, ctx);
 
-       if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SIM) != NULL)
-               dbus_plugin_setup_sim_interface(object, ctx);
-
+       /* GPS */
        if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_GPS) != NULL)
                dbus_plugin_setup_gps_interface(object, ctx);
 
-       g_dbus_object_manager_server_export (ctx->manager, G_DBUS_OBJECT_SKELETON (object));
+       /* Export the Object to Manager */
+       g_dbus_object_manager_server_export(ctx->manager, G_DBUS_OBJECT_SKELETON(object));
 
 OUT:
        if (path)
                g_free(path);
 }
 
+static void refresh_object(struct custom_data *ctx)
+{
+       GSList *plugins;
+       GSList *cur;
+       TcorePlugin *p;
+       CoreObject *co;
+       dbg("Entry");
+
+       if (!ctx->manager) {
+               err("not ready..");
+               return;
+       }
+
+       plugins = tcore_server_ref_plugins(ctx->server);
+       if (!plugins)
+               return;
+
+       cur = plugins;
+       for (cur = plugins; cur; cur = cur->next) {
+               p = cur->data;
+               /* AT Standard Plug-in is not considered */
+               if ((p == NULL)
+                               || (strcmp(tcore_plugin_ref_plugin_name(p), "AT") == 0)) {
+                       dbg("Plug-in Name: [%s]", tcore_plugin_ref_plugin_name(p));
+                       continue;
+               }
+
+               co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
+               if (!co)
+                       continue;
+
+               /* Add modem */
+               add_modem(ctx, p);
+       }
+}
+
 static TReturn send_response(Communicator *comm, UserRequest *ur, enum tcore_response_command command, unsigned int data_len, const void *data)
 {
        struct custom_data *ctx = NULL;
@@ -185,14 +237,20 @@ static TReturn send_notification(Communicator *comm, CoreObject *source, enum tc
 {
        struct custom_data *ctx = NULL;
        TelephonyObjectSkeleton *object;
-       TcorePlugin *p = tcore_object_ref_plugin(source);
-       const char *cp_name = tcore_server_get_cp_name_by_plugin(p);
+       TcorePlugin *p;
+       const char *cp_name;
        char *path = NULL;
 
-       if (!cp_name)
+       if (command == TNOTI_SERVER_ADDED_PLUGIN)
+               p = (TcorePlugin *)data;
+       else
+               p = tcore_object_ref_plugin(source);
+
+       cp_name = tcore_server_get_cp_name_by_plugin(p);
+       if (cp_name == NULL)
                return TCORE_RETURN_FAILURE;
 
-       dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
+       dbg("Notification!!! (command = 0x%x, data_len = %d)", command, data_len);
 
        ctx = tcore_communicator_ref_user_data(comm);
        if (!ctx) {
@@ -200,63 +258,70 @@ static TReturn send_notification(Communicator *comm, CoreObject *source, enum tc
                return TCORE_RETURN_FAILURE;
        }
 
-       path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
-
-       dbg("path = [%s]", path);
+       dbg("CP Name: [%s]", path);
+       if (cp_name) {
+               path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
+       }
+       else {
+               path = g_strdup_printf("%s", MY_DBUS_PATH);
+       }
+       dbg("PATH: [%s]", path);
 
        object = g_hash_table_lookup(ctx->objects, path);
-       dbg("dbus inteface object = %p", object);
+       dbg("DBUS interface Object = [0x%x]", object);
 
        switch (command & (TCORE_NOTIFICATION | 0x0FF00000)) {
                case TNOTI_CALL:
-                       dbus_plugin_call_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_call_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_SS:
-                       dbus_plugin_ss_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_ss_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_PS:
                        break;
 
                case TNOTI_SIM:
-                       dbus_plugin_sim_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_sim_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_SAP:
-                       dbus_plugin_sap_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_sap_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_PHONEBOOK:
-                       dbus_plugin_phonebook_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_phonebook_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_MODEM:
-                       if (command == TNOTI_MODEM_ADDED)
-                               add_modem(ctx, p);
-
-                       dbus_plugin_modem_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_modem_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_SMS:
-                       dbus_plugin_sms_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_sms_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_SAT:
-                       dbus_plugin_sat_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_sat_notification(ctx, cp_name, object, command, data_len, data);
                        break;
                case TNOTI_CUSTOM:
                        break;
 
                case TNOTI_NETWORK:
-                       dbus_plugin_network_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_network_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_GPS:
-                       dbus_plugin_gps_notification(ctx, NULL, object, command, data_len, data);
+                       dbus_plugin_gps_notification(ctx, cp_name, object, command, data_len, data);
                        break;
 
                case TNOTI_SERVER:
+                       dbg("Server Notification");
+                       if (command == TNOTI_SERVER_ADDED_PLUGIN) {
+                               dbg("Plug-in is added... Refresh the context");
+                               refresh_object(ctx);
+                       }
                        break;
 
                default:
@@ -274,11 +339,56 @@ on_manager_getmodems (TelephonyManager *mgr,
                gpointer                user_data)
 {
        struct custom_data *ctx = user_data;
-       char **cp_list;
+       GSList *cp_name_list;
+       gchar **list;
+       char *name;
+       int count;
+       dbg("Entry");
+
+       cp_name_list = tcore_server_get_cp_name_list(ctx->server);
+       if (cp_name_list == NULL) {
+               telephony_manager_complete_get_modems(mgr, invocation, NULL);
+               return TRUE;
+       }
 
-       cp_list = tcore_server_get_cp_name_list(ctx->server);
+       count = g_slist_length(cp_name_list);
+       if (count == 0) {
+               err("No Modems present");
+               telephony_manager_complete_get_modems(mgr, invocation, NULL);
+               return TRUE;
+       }
 
-       telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)cp_list);
+       dbg("count: %d", count);
+       list = g_try_malloc0(sizeof(gchar *) * (count+1));
+       if (list == NULL) {
+               err("Failed to allocate memory");
+               g_slist_free_full(cp_name_list, g_free);
+
+               telephony_manager_complete_get_modems(mgr, invocation, NULL);
+               return TRUE;
+       }
+
+       count = 0;
+       for ( ; cp_name_list ; cp_name_list = cp_name_list->next) {
+               name = cp_name_list->data;
+               if (name == NULL)
+                       continue;
+
+               list[count] = g_strdup(name);
+               dbg("list[%d]: %s", count, list[count]);
+               count++;
+       }
+
+       telephony_manager_complete_get_modems(mgr, invocation, (const gchar **)list);
+
+       /* Free memory */
+       for (;count >= 0; count--)
+               g_free(list[count]);
+
+       g_free(list);
+
+       /* Freeing the received list of CP names */
+       g_slist_free_full(cp_name_list, g_free);
 
        return TRUE;
 }
@@ -312,6 +422,8 @@ static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer u
        }
 
        dbg("done to acquire the dbus");
+
+       refresh_object(ctx);
 }
 
 struct tcore_communitor_operations ops = {
@@ -365,6 +477,8 @@ static gboolean on_init(TcorePlugin *p)
 
        data->manager = g_dbus_object_manager_server_new (MY_DBUS_PATH);
 
+       refresh_object(data);
+
        return TRUE;
 }
 
index b64ac20336fe35c2a9dfa2439999ef157fef34eb..567db75d8998b7950d3f5eb4c25282a7e5ec8c08 100644 (file)
@@ -223,6 +223,8 @@ gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, stru
        telephony_object_skeleton_set_modem(object, modem);
        g_object_unref(modem);
 
+       dbg("modem = %p", modem);
+
        g_signal_connect (modem,
                        "handle-set-power",
                        G_CALLBACK (on_modem_set_power),
index 799881998ea954cc9c344db8665c7489858786b3..75cb6f57aac0d763d7476e74e174d93adaad40da 100644 (file)
@@ -223,7 +223,6 @@ on_network_search (TelephonyNetwork *network,
                GDBusMethodInvocation *invocation,
                gpointer user_data)
 {
-#if 1
        struct custom_data *ctx = user_data;
        UserRequest *ur = NULL;
        TReturn ret;
@@ -236,31 +235,6 @@ on_network_search (TelephonyNetwork *network,
                telephony_network_complete_search(network, invocation, NULL, ret);
                tcore_user_request_unref(ur);
        }
-#else
-       /* Dummy return */
-       GVariant *result = NULL;
-       GVariantBuilder b;
-       int i;
-       char *buf;
-
-       g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
-       for (i = 0; i < 3; i++) {
-               g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
-               g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string("45001"));
-               g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(4));
-               g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(2));
-               g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string("Samsung"));
-
-               g_variant_builder_close(&b);
-       }
-
-       result = g_variant_builder_end(&b);
-
-       telephony_network_complete_search(network, invocation, result, 0);
-       g_variant_unref(result);
-#endif
 
        return TRUE;
 }
@@ -607,6 +581,8 @@ gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, st
        telephony_object_skeleton_set_network(object, network);
        g_object_unref(network);
 
+       dbg("network = %p", network);
+
        g_signal_connect (network,
                        "handle-search",
                        G_CALLBACK (on_network_search),
index 94fc41f55eda1a4a18c2f31d5ffd02a4c58ae5b2..ab551eff1a86e644978e422d26be0d01f8ef536f 100644 (file)
@@ -60,10 +60,11 @@ static gboolean on_phonebook_get_init_status(TelephonyPhonebook *phonebook, GDBu
        struct tel_phonebook_support_list *list = NULL;
        CoreObject *co_pb = NULL;
        TcorePlugin *plugin = NULL;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        dbg("Func Entrance");
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        co_pb = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
        if (!co_pb) {
                dbg("error- co_pb is NULL");
index 3c4b200a9cae5d66cca2677c901370f1be4ffcf2..8af033b71f36a5461bf0901888bf8805ba8888c7 100644 (file)
@@ -4160,7 +4160,7 @@ static gboolean _sat_manager_handle_setup_call_confirm(struct custom_data *ctx,
                        gchar *confirmed_text, *text, *call_number;
                        GVariant *icon_id;
 
-                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
                                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
                        }
@@ -4308,7 +4308,7 @@ static gboolean _sat_manager_handle_launch_browser_confirm(struct custom_data *c
                        gchar *gateway_proxy = NULL;
                        GVariant *icon_id = NULL;
 
-                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
                                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
                        } else {
@@ -4404,7 +4404,7 @@ static gboolean _sat_manager_handle_open_channel_confirm(struct custom_data *ctx
                        GVariant *bearer_detail;
 
                        //emit send_dtmf signal
-                       plg_name = tcore_plugin_ref_plugin_name(plg);
+                       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
                        if (plg_name) {
                                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
                        } else {
@@ -4556,7 +4556,7 @@ static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_da
        }
 
        //emit play tone signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        }
@@ -4615,7 +4615,7 @@ static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_dat
        }
 
        //emit send sms signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        }
@@ -4675,7 +4675,7 @@ static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data
        }
 
        //emit send ss signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        }
@@ -4733,8 +4733,8 @@ static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_da
                return TRUE;
        }
 
-       //emit send ussd signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       /* emit send ussd signal */
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        }
@@ -4862,7 +4862,7 @@ static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_da
        }
 
        //emit send_dtmf signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        } else {
@@ -4921,7 +4921,7 @@ static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom
        }
 
        //emit send_dtmf signal
-       plg_name = tcore_plugin_ref_plugin_name(plg);
+       plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
        if (plg_name) {
                path = g_strdup_printf("%s/%s", MY_DBUS_PATH, plg_name);
        } else {
index b0bc04e1a8567b5ab7df470d4b87e0daee6c10fd..f54b85a974e660948aebfc4cda6f0795729003e3 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
 #include "common.h"
 
 
-static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status )
+static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status,
+                                       const char *plugin_name)
 {
        UserRequest *ur = NULL;
-       TcorePlugin *plugin = NULL;
 
        switch(sim_status){
                case SIM_STATUS_INITIALIZING :
@@ -59,10 +59,9 @@ static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_stat
                        if(ctx->sim_recv_first_status == FALSE) {
                                int rv = 0;
                                dbg("received sim status at first time");
-                               plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
 
                                dbg("req - TREQ_SIM_GET_ECC ");
-                               ur = tcore_user_request_new(ctx->comm, tcore_plugin_get_description(plugin)->name);
+                               ur = tcore_user_request_new(ctx->comm, plugin_name);
                                tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
                                rv = tcore_communicator_dispatch_request(ctx->comm, ur);
                                if(rv != TCORE_RETURN_SUCCESS) {
@@ -86,10 +85,11 @@ static gboolean on_sim_get_init_status(TelephonySim *sim, GDBusMethodInvocation
        gboolean b_changed = FALSE;
        CoreObject *co_sim = NULL;
        TcorePlugin *plugin = NULL;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        dbg("Func Entrance");
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
        if (!co_sim) {
                dbg("error- co_sim is NULL");
@@ -112,10 +112,11 @@ static gboolean on_sim_get_card_type(TelephonySim *sim, GDBusMethodInvocation *i
        enum tel_sim_type type = SIM_TYPE_UNKNOWN;
        CoreObject *co_sim = NULL;
        TcorePlugin *plugin = NULL;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        dbg("Func Entrance");
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
        if (!co_sim) {
                dbg("error- co_sim is NULL");
@@ -136,9 +137,10 @@ static gboolean on_sim_get_imsi(TelephonySim *sim, GDBusMethodInvocation *invoca
        struct tel_sim_imsi *n_imsi;
        CoreObject *co_sim = NULL;
        TcorePlugin *plugin = NULL;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        dbg("Func Entrance");
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
        if (!co_sim) {
                dbg("error- co_sim is NULL");
@@ -1817,7 +1819,7 @@ gboolean dbus_plugin_sim_notification(struct custom_data *ctx, const char *plugi
        switch (command) {
                case TNOTI_SIM_STATUS:
                        dbg("notified sim_status[%d]", n_sim_status->sim_status);
-                       dbus_sim_data_request(ctx, n_sim_status->sim_status);
+                       dbus_sim_data_request(ctx, n_sim_status->sim_status, plugin_name);
                        telephony_sim_emit_status (sim, n_sim_status->sim_status);
                        break;
 
index 72558cd2cf3f9e20842fa99910b7c433e19027fd..cf392dbb986e44ac6ecce62ae991aeb8aa22681f 100644 (file)
--- a/src/sms.c
+++ b/src/sms.c
@@ -86,173 +86,6 @@ on_sms_send_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
                
        return  TRUE;
 }
-/*
-
-static gboolean
-on_sms_send_cdma_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
-       const gchar *sca,
-       gint tpdu_length,
-       const gchar *tpdu_data,
-       gint moreMsg,
-       gpointer user_data)
-{
-#if 0
-       cdmaMsg.more = sipc_util_marshal_object_get_int(in_obj, "More");
-       cdmaMsg.cdmaMsgInfo.ParamMask = sipc_util_marshal_object_get_int(in_obj, "ParamMask");
-       cdmaMsg.cdmaMsgInfo.MsgType = sipc_util_marshal_object_get_int(in_obj, "MsgType");
-
-       switch(cdmaMsg.cdmaMsgInfo.MsgType)
-       {
-               case SMS_MESSAGETYPE_SUBMIT: {
-                       gchar *dstAddr_szAddress;
-                       gchar *dstSubAddr_szAddress;
-                       gchar *szData;
-                       gchar *callBackNumer_szAddress;
-
-                        Origination address
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
-                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                        Origination subaddress
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
-                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
-                       szData = sipc_util_marshal_object_get_string(in_obj, "szData");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
-
-                        Validity period - Absolute
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.year = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.year");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.month = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.month");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.day = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.day");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.hours = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.hours");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.minutes");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "ValidityPeriodAbs.seconds");
-
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.ValidityPeriodRel = sipc_util_marshal_object_get_char(in_obj, "ValidityPeriodRel");
-
-                        Deferred delivery time - Absolute (not supported)
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.year = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.year");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.month = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.month");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.day = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.day");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.hours = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.hours");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.minutes = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.minutes");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeAbs.seconds = sipc_util_marshal_object_get_int(in_obj, "DeferredDelTimeAbs.seconds");
-
-                        Deferred delivery time - Relative (not supported)
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.DeferredDelTimeRel = sipc_util_marshal_object_get_char(in_obj, "DeferredDelTimeRel");
-
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Priority = sipc_util_marshal_object_get_int(in_obj, "Priority");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.Privacy = sipc_util_marshal_object_get_int(in_obj, "Privacy");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bUserAckRequest = sipc_util_marshal_object_get_int(in_obj, "bUserAckRequest");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.bDeliveryAckRequest = sipc_util_marshal_object_get_int(in_obj, "bDeliveryAckRequest");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.AlertPriority= sipc_util_marshal_object_get_int(in_obj, "AlertPriority");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.MsgLang= sipc_util_marshal_object_get_int(in_obj, "MsgLang");
-
-                        Callback number address
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.Digit = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.Digit");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberMode = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberMode");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberType = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "CallBackNumer.NumberPlan");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "CallBackNumer.szAddrLength");
-                       callBackNumer_szAddress = sipc_util_marshal_object_get_string(in_obj, "CallBackNumer.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outSubmit.CallBackNumber.szAddress[0]), callBackNumer_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                       }
-                       break;
-
-               case SMS_MESSAGETYPE_CANCEL: {
-                       gchar *dstAddr_szAddress;
-                       gchar *dstSubAddr_szAddress;
-
-                        Origination address
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
-                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                        Origination subaddress
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
-                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outCancel.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outCancel.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
-
-                       }
-                       break;
-
-               case SMS_MESSAGETYPE_USER_ACK: {
-                       gchar *dstAddr_szAddress;
-                       gchar *dstSubAddr_szAddress;
-                       gchar *szData;
-
-                        Origination address
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.Digit = sipc_util_marshal_object_get_int(in_obj, "DstAddr.Digit");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberMode = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberMode");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberType = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.NumberPlan = sipc_util_marshal_object_get_int(in_obj, "DstAddr.NumberPlan");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstAddr.szAddrLength");
-                       dstAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstAddr.szAddress[0]), dstAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                        Origination subaddress
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.SubType = sipc_util_marshal_object_get_int(in_obj, "DstSubAddr.SubType");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.Odd = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.Odd");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddrLength = sipc_util_marshal_object_get_char(in_obj, "DstSubAddr.szAddrLength");
-                       dstSubAddr_szAddress = sipc_util_marshal_object_get_string(in_obj, "DstSubAddr.szAddress");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.DstSubAddr.szAddress[0]), dstSubAddr_szAddress, SMS_MAXLENGTH_SMS_ADDRESS);
-
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.TeleService = sipc_util_marshal_object_get_int(in_obj, "TeleService");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.bBearerReplySeqRequest = sipc_util_marshal_object_get_int(in_obj, "bBearerReplySeqRequest");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.ReplySeqNumber = sipc_util_marshal_object_get_char(in_obj, "ReplySeqNumber");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgId = sipc_util_marshal_object_get_int(in_obj, "MsgId");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgEncoding = sipc_util_marshal_object_get_int(in_obj, "MsgEncoding");
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.MsgLength = sipc_util_marshal_object_get_int(in_obj, "MsgLength");
-                       szData = sipc_util_marshal_object_get_string(in_obj, "szData");
-                       memcpy(&(cdmaMsg.cdmaMsgInfo.MsgData.outAck.szData[0]), szData, SMS_MAXLENGTH_SMS_MO_USER_DATA);
-                       cdmaMsg.cdmaMsgInfo.MsgData.outAck.UserResponseCode = sipc_util_marshal_object_get_char(in_obj, "UserResponseCode");
-
-                       }
-                       break;
-               default:
-                       break;
-       }
-
-       tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_cdma_msg), &cdmaMsg);
-       tcore_user_request_set_command(ur, TREQ_SMS_SEND_CDMA_MSG);
-
-       ret = tcore_communicator_dispatch_request(comm, ur);
-       if (ret != TCORE_RETURN_SUCCESS) {
-               // api_err = TAPI_API_OPERATION_FAILED;
-               err("[tcore_SMS] communicator_dispatch_request is fail [0x%x] !!!", ret);
-               return  FALSE;
-       }
-#endif
-       return TRUE;
-}
-
-*/
 
 static gboolean
 on_sms_read_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
@@ -770,10 +603,11 @@ on_sms_get_sms_ready_status(TelephonySms *sms, GDBusMethodInvocation *invocation
        struct custom_data *ctx = user_data;
        CoreObject *co_sms = NULL;
        TcorePlugin *plugin = NULL;
+       char *cp_name = GET_PLUGIN_NAME(invocation);
 
        dbg("Func Entrance");
 
-       plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
+       plugin = tcore_server_find_plugin(ctx->server, cp_name);
        co_sms = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SMS);
        if (!co_sms) {
                dbg("error- co_sms is NULL");
@@ -793,6 +627,8 @@ gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct
        telephony_object_skeleton_set_sms(object, sms);
        g_object_unref(sms);
 
+       dbg("sms = %p", sms);
+
        g_signal_connect(sms, "handle-send-msg", G_CALLBACK (on_sms_send_msg), ctx);
        g_signal_connect(sms, "handle-read-msg", G_CALLBACK (on_sms_read_msg), ctx);
        g_signal_connect(sms, "handle-save-msg", G_CALLBACK (on_sms_save_msg), ctx);
@@ -848,20 +684,6 @@ gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, stru
                        }
                        break;
 
-               case TRESP_SMS_SEND_CDMA_MSG: {
-                       const struct tresp_sms_send_cdma_msg *resp = data;
-
-                       dbg("receive TRESP_SMS_SEND_CDMA_MSG");
-                       dbg("resp->result = 0x%x", resp->result);
-#if 0
-                       resp->result
-                       resp->causeCode.ReplySeqNumber
-                       resp->causeCode.ErrClass
-                       resp->causeCode.Cause
-#endif
-                       }
-                       break;
-
                case TRESP_SMS_READ_MSG: {
                        const struct tresp_sms_read_msg *resp = data;
                        gchar *sca = NULL;
@@ -1277,195 +1099,10 @@ gboolean dbus_plugin_sms_notification(struct custom_data *ctx, const char *plugi
                        }
                        break;
 
-               case TNOTI_SMS_INCOM_EX_MSG: {
-#if 0
-                       noti->cdmaMsg.ParamMask), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgType), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                       switch(noti->cdmaMsg.MsgType)
-                       {
-                               case SMS_MESSAGETYPE_DELIVER:
-                                       /* Origination address */
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       /* Origination subaddress */
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.OrigSubAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inDeliver.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       /* Message center time stamp */
-                                       void *)&(noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       /* Validity period - Absolute */
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inDeliver.ValidityPeriodRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                                       /* Deferred delivery time - Absolute (not supported) */
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       /* Deferred delivery time - Relative (not supported) */
-                                       noti->cdmaMsg.MsgData.inDeliver.DeferredDelTimeRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inDeliver.Priority), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.Privacy), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.NumMsg), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.bUserAckRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.bDeliveryAckRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.AlertPriority), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.MsgLang), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       /* Callback number address */
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliver.CallBackNumer.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inDeliver.Display), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       break;
-
-                               case SMS_MESSAGETYPE_DELIVERY_ACK:
-                                       /* Origination address */
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       /* Origination subaddress */
-                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.OrigSubAddr.szAddress), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inAck.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inAck.UserResponseCode), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                                       /* Message center time stamp */
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inAck.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       break;
-
-                               case SMS_MESSAGETYPE_USER_ACK:
-                                       /* Origination address */
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.Digit), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberMode), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.NumberPlan), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigAddr.szAddress[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       /* Origination subaddress */
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.SubType), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.Odd), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.szAddrLength), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.OrigSubAddr.szAddress), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                                       noti->cdmaMsg.MsgData.inDeliverAck.TeleService), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                                       /* Message center time stamp */
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                                       noti->cdmaMsg.MsgData.inDeliverAck.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                                       break;
-                               default:
-                                       break;
-                       }
-#endif
-                       }
+               case TNOTI_SMS_INCOM_EX_MSG:
                        break;
 
-               case TNOTI_SMS_CB_INCOM_EX_MSG: {
-#if 0
-                       noti->cdmaMsg.MsgData.inBc.ServiceCategory), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                       noti->cdmaMsg.MsgData.inBc.MsgId), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.bBearerReplySeqRequest), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ReplySeqNumber), SIPC_MARSHAL_DATA_CHAR_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MsgEncoding), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MsgLength), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.szData[0]), SIPC_MARSHAL_DATA_STRING_TYPE);
-
-                       /* Message center time stamp */
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MessageCenterTimeStamp.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                       /* Validity period - Absolute */
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.year), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.month), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.day), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.hours), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.minutes), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodAbs.seconds), SIPC_MARSHAL_DATA_INT_TYPE);
-
-                       noti->cdmaMsg.MsgData.inBc.ValidityPeriodRel), SIPC_MARSHAL_DATA_CHAR_TYPE);
-
-                       noti->cdmaMsg.MsgData.inBc.Priority), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.AlertPriority), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.MsgLang), SIPC_MARSHAL_DATA_INT_TYPE);
-                       noti->cdmaMsg.MsgData.inBc.Display), SIPC_MARSHAL_DATA_INT_TYPE);
-
-#endif
-                       }
+               case TNOTI_SMS_CB_INCOM_EX_MSG:
                        break;
 
                case TNOTI_SMS_MEMORY_STATUS: {
index ec897837f7e2e0bc4be03049fd147fbb99d88dfe..ad343cc98b34d786c2cbd80dbefeabb35a7b1a2c 100644 (file)
--- a/src/ss.c
+++ b/src/ss.c
@@ -706,6 +706,8 @@ gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct
        telephony_object_skeleton_set_ss(object, ss);
        g_object_unref(ss);
 
+       dbg("ss = %p", ss);
+
        g_signal_connect (ss,
                        "handle-activate-barring",
                        G_CALLBACK (on_ss_activate_barring),