dbg("HAL is NULL");
return ret;
}
+ dbg("hal: [0x%x]", hal);
/* Create Pending Request */
pending = tcore_pending_new(co, 0);
tcore_pending_link_user_request(pending, ur);
ret = tcore_hal_send_request(hal, pending);
+ dbg("ret: [0x%x]", ret);
return ret;
}
#include "co_gps.h"
#define INIT_CORE_OBJECT(initializer, plugin, type, hal) do { \
- CoreObject *co; \
if (initializer != NULL) { \
co = tcore_object_clone_template_object(plugin, type); \
if (co == NULL) { \
if (co_list->data == NULL)
continue;
- dbg("Core Object type: [0x%x]", co_list->data);
+ msg(" Core Object type: [0x%x]", co_list->data);
}
}
static gboolean _init_core_object_by_type(unsigned int type,
TcorePlugin *plugin, TcoreHal *hal, struct object_initializer *initializer_list)
{
+ CoreObject *co;
gboolean ret = FALSE;
switch (type) {
case CORE_OBJECT_TYPE_MODEM:
INIT_CORE_OBJECT(initializer_list->modem_init,
plugin, type, hal);
+
+ /* Send Notification for MODEM ADDED */
+ if (ret == TRUE)
+ tcore_server_send_notification(tcore_plugin_ref_server(plugin),
+ co, TNOTI_MODEM_ADDED, 0, NULL);
break;
case CORE_OBJECT_TYPE_CALL:
TcoreAT *at;
struct callback_type *cb = NULL;
GSList *l = NULL;
+ dbg("Core Object Type: [0x%x] HAL: [0x%x]", co->type, hal);
if (co == NULL)
return TCORE_RETURN_EINVAL;
{
int qlen = 0;
enum tcore_pending_priority priority;
+ dbg("HAL: [0x%x]", hal);
if ((hal == NULL) || (pending == NULL))
return TCORE_RETURN_EINVAL;
{
tcore_cmux_object *cmux_obj;
GSList *tmp_obj;
+ dbg("Entry");
/* Check across CMUX Objects list for specific CMUX Object */
- tmp_obj = g_cmux_obj;
- while (tmp_obj) {
+ for (tmp_obj = g_cmux_obj ; tmp_obj ; tmp_obj = tmp_obj->next) {
cmux_obj = tmp_obj->data;
- tmp_obj = tmp_obj->next;
-
if (cmux_obj == NULL)
continue;
/* Check for matching 'plugin' */
- if (plugin == cmux_obj->plugin)
+ if (plugin == cmux_obj->plugin) {
+ dbg("Found CMUX object");
return cmux_obj;
+ }
}
return NULL;
return TCORE_RETURN_FAILURE;
}
- channel_name = tcore_hal_get_name(hal);
- dbg("HAL name: %s", channel_name);
-
/*
* Get CMUX Object from Modem Interface Plug-in
*/
cmux_obj = _cmux_get_cmux_object(tcore_hal_ref_plugin(hal));
if (cmux_obj == NULL) {
- /* Free memory */
- g_free(channel_name);
-
+ err("Failed to find CMUX object");
return TCORE_RETURN_FAILURE;
}
channel_id = cmux_obj->max_cmux_channels + 1;
+ channel_name = tcore_hal_get_name(hal);
+ dbg("HAL name: %s", channel_name);
+
if (channel_name != NULL) {
- int i = 0;
+ int i;
- while (cmux_obj->max_cmux_channels > i) {
+ /*
+ * Channel 0 is dedicated to CMUX Control Channel,
+ * hence starting from 1.
+ */
+ for (i = 1 ; cmux_obj->max_cmux_channels > i ; i++) {
hal_name =
tcore_hal_get_name(cmux_obj->internal_mux.channel_info[i]->hal);
+ dbg("HAL name: %s", hal_name);
+ if (hal_name == NULL)
+ continue;
/*
* Comparing all Logical HAL names with required HAL name.
/* Free HAL name */
g_free(hal_name);
-
- /* Increment to next Logical HAL */
- i++;
}
/* Free memory */
return NULL;
}
-#if 1
for (list = s->modems; list; list = list->next) {
modem = list->data;
if (modem == NULL) {
dbg("[%d] CP Name: [%s]", i++, modem->cp_name);
cp_name_list = g_slist_append(cp_name_list, g_strdup(modem->cp_name));
}
-#else
- /* (+1) is considered for NULL string to define the last string */
- cp_name_list = g_try_new0(char *, list_count);
- if (cp_name_list == NULL) {
- err("Failed to allocate memory");
- return NULL;
- }
-
- for (list = s->modems; list; list = list->next) {
- modem = list->data;
- if (modem == NULL) {
- dbg("No modem - continue");
- continue;
- }
-
- cp_name_list[i] = g_strdup(modem->cp_name);
- dbg("[%d] CP Name: [%s]", i, cp_name_list[i]);
-
- i++;
- }
-#endif
/* 'cp_name_list' would be freed by the calling function */
return cp_name_list;