void tcore_server_unregister_modem(Server *s, TcorePlugin *modem_iface_plugin);
gboolean tcore_server_update_modem_plugin(TcorePlugin *modem_iface_plugin,
TcorePlugin *modem_plugin);
-char **tcore_server_get_cp_name_list(Server *s);
+GSList *tcore_server_get_cp_name_list(Server *s);
const char *tcore_server_get_cp_name_by_plugin(TcorePlugin *plugin);
gboolean tcore_server_add_cp_mapping_tbl_entry(TcorePlugin *modem_iface_plugin,
return TRUE;
}
-char **tcore_server_get_cp_name_list(Server *s)
+GSList *tcore_server_get_cp_name_list(Server *s)
{
- char **cp_name_list = NULL;
+ GSList *cp_name_list = NULL;
GSList *list;
unsigned int list_count;
TcoreModem *modem;
return NULL;
}
+#if 1
+ for (list = s->modems; list; list = list->next) {
+ modem = list->data;
+ if (modem == NULL) {
+ dbg("No modem - continue");
+ continue;
+ }
+
+ 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) {
}
cp_name_list[i] = g_strdup(modem->cp_name);
- dbg("CP Name[%d] = %s", i, cp_name_list[i]);
+ 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;