static void add_modem(struct custom_data *ctx, TcorePlugin *p)
{
TelephonyObjectSkeleton *object;
+ static Storage *strg;
CoreObject *co_sim;
- const char *cp_name = tcore_server_get_cp_name_by_plugin(p);
char *path = NULL;
-
+ const char *cp_name;
+ gboolean rv;
dbg("Entry");
- if (cp_name == NULL)
+ /* Get CP Name */
+ cp_name = tcore_server_get_cp_name_by_plugin(p);
+ if (cp_name == NULL) {
+ err("CP Name is NULL");
return;
+ }
path = g_strdup_printf("%s/%s", MY_DBUS_PATH, cp_name);
- dbg("path = [%s]", path);
+ dbg("PATH: [%s]", path);
object = g_hash_table_lookup(ctx->objects, path);
if (object == NULL) {
/* Export the Object to Manager */
g_dbus_object_manager_server_export(ctx->manager, G_DBUS_OBJECT_SKELETON(object));
+ /*
+ * Set Telephony Ready registry
+ *
+ * At this point we can convey upper Layer that Telephony is Ready.
+ */
+ strg = tcore_server_find_storage(ctx->server, "vconf");
+ rv = tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, TRUE);
+ if(rv == FALSE){
+ err("Set Telephony Ready (TRUE) to registry - FAIL");
+ } else {
+ dbg("Set Telephony Ready (TRUE) to registry - SUCCESS");
+ }
+
OUT:
- if (path)
- g_free(path);
+ /* Freeing memory */
+ g_free(path);
}
static void refresh_object(struct custom_data *ctx)
CoreObject *co;
dbg("Entry");
- if (!ctx->manager) {
+ if (ctx->manager == NULL) {
err("not ready..");
return;
}
plugins = tcore_server_ref_plugins(ctx->server);
- if (!plugins)
+ if (plugins == NULL)
return;
cur = plugins;
}
co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
- if (!co)
+ if (co == NULL)
continue;
/* Add modem */
dbg("Response Command = [0x%x], data_len = %d", command, data_len);
ctx = tcore_communicator_ref_user_data(comm);
- if (!ctx) {
+ if (ctx == NULL) {
dbg("user_data is NULL");
return FALSE;
}
dbg("Notification!!! (command = 0x%x, data_len = %d)", command, data_len);
ctx = tcore_communicator_ref_user_data(comm);
- if (!ctx) {
+ if (ctx == NULL) {
dbg("user_data is NULL");
return TCORE_RETURN_FAILURE;
}
static void on_bus_acquired(GDBusConnection *conn, const gchar *name, gpointer user_data)
{
- gboolean rv = FALSE;
- static Storage *strg;
struct custom_data *ctx = user_data;
TelephonyManager *mgr;
-
- info("dbus registered");
+ info("DBUS Registered");
/* Add interface to default object path */
mgr = telephony_manager_skeleton_new();
g_dbus_object_manager_server_set_connection (ctx->manager, conn);
- //set telephony ready registry
- strg = tcore_server_find_storage(ctx->server, "vconf");
-
- rv = tcore_storage_set_bool(strg, STORAGE_KEY_TELEPHONY_READY, TRUE);
- if(!rv){
- dbg("fail to set the telephony status to registry");
- }
-
- dbg("done to acquire the dbus");
+ dbg("Aquire DBUS - COMPLETE");
+ /* Refresh Object */
refresh_object(ctx);
}
struct custom_data *data;
guint id;
- if (!p)
+ if (p == NULL)
return FALSE;
dbg("i'm init!");
data = calloc(sizeof(struct custom_data), 1);
- if (!data) {
+ if (data == NULL) {
return FALSE;
}
struct custom_data *data;
Communicator *comm;
- if (!p)
+ if (p == NULL)
return;
dbg("i'm unload");
comm = tcore_server_find_communicator(tcore_plugin_ref_server(p), "dbus");
- if (!comm)
+ if (comm == NULL)
return;
data = tcore_communicator_ref_user_data(comm);
- if (!data)
+ if (data == NULL)
return;
g_hash_table_destroy(data->objects);