{
struct custom_data *ctx = user_data;
TcorePlugin *plugin = 0;
- GSList *o_list = 0;
CoreObject *o = 0;
CallObject *co = 0;
return FALSE;
}
- o_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
- if ( !o_list ) {
- dbg("[ error ] co_list : 0");
+ o = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+ if ( !o ) {
+ dbg("no core object call");
return FALSE;
}
- o = (CoreObject *)o_list->data;
- g_slist_free(o_list);
-
co = tcore_call_object_find_by_id( o, call_id );
if ( !co ) {
dbg("[ error ] co : 0");
return FALSE;
}
- list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_CALL);
- if ( !list ) {
- dbg("[ error ] co_list : 0");
+ o = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_CALL);
+ if ( !o )
return FALSE;
- }
-
- o = (CoreObject *)list->data;
- g_slist_free(list);
g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
gboolean dbus_plugin_call_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
{
int i = 0;
- GSList *co_list;
CoreObject *co_call;
char *modem_name = NULL;
TcorePlugin *p = NULL;
if (!p)
return FALSE;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
- if (!co_list) {
- return FALSE;
- }
-
- co_call = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_call) {
+ co_call = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL);
+ if (!co_call)
return FALSE;
- }
switch (command) {
case TRESP_CALL_DIAL: {
TelephonyObjectSkeleton *object;
char *plugin_name = NULL;
char *path = NULL;
- GSList *co_list = NULL;
plugin_name = tcore_plugin_ref_plugin_name(p);
if (!plugin_name)
/* Add interfaces */
dbus_plugin_setup_modem_interface(object, ctx);
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_CALL);
- if (co_list) {
- g_slist_free(co_list);
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_CALL) != NULL)
dbus_plugin_setup_call_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
- if (co_list) {
- g_slist_free(co_list);
+
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK) != NULL)
dbus_plugin_setup_network_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SS);
- if (co_list) {
- g_slist_free(co_list);
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SS) != NULL)
dbus_plugin_setup_ss_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
- if (co_list) {
- g_slist_free(co_list);
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS) != NULL)
dbus_plugin_setup_sms_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAT);
- if (co_list) {
- g_slist_free(co_list);
+
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAT) != NULL)
dbus_plugin_setup_sat_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_PHONEBOOK);
- if (co_list) {
- g_slist_free(co_list);
+
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_PHONEBOOK) != NULL)
dbus_plugin_setup_phonebook_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SAP);
- if (co_list) {
- g_slist_free(co_list);
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SAP) != NULL)
dbus_plugin_setup_sap_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SIM);
- if (co_list) {
- g_slist_free(co_list);
+ if (tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SIM) != NULL)
dbus_plugin_setup_sim_interface(object, ctx);
- }
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_GPS);
- if (co_list) {
- g_slist_free(co_list);
+ 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));
{
GSList *plugins;
GSList *cur;
- GSList *co_list;
TcorePlugin *p;
+ CoreObject *co;
if (!ctx->manager) {
dbg("not ready..");
if (!p)
continue;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_MODEM);
- if (!co_list)
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
+ if (!co)
continue;
- if (!tcore_object_get_hal(co_list->data)) {
- g_slist_free(co_list);
+ if (!tcore_object_get_hal(co))
continue;
- }
-
- g_slist_free(co_list);
add_modem(ctx, p);
}
struct custom_data *ctx = user_data;
GSList *plugins;
GSList *cur;
- GSList *co_list;
int max_count = 0;
int count;
TcorePlugin *p;
+ CoreObject *co;
gchar **list;
plugins = tcore_server_ref_plugins(ctx->server);
if (!p)
continue;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_MODEM);
- if (!co_list)
+ co = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_MODEM);
+ if (!co)
continue;
- if (!tcore_object_get_hal(co_list->data)) {
- g_slist_free(co_list);
+ if (!tcore_object_get_hal(co))
continue;
- }
- g_slist_free(co_list);
list[count] = g_strdup(tcore_plugin_get_description(p)->name);
count++;
{
const struct tresp_gps_set_frequency_aiding*resp_gps_frequency_aiding = data;
- GSList *co_list;
CoreObject *co_gps;
char *modem_name = NULL;
TcorePlugin *p = NULL;
if (!p)
return FALSE;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_GPS);
- if (!co_list) {
+ co_gps = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_GPS);
+ if (!co_gps)
return FALSE;
- }
-
- co_gps = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_gps) {
- return FALSE;
- }
switch (command) {
case TRESP_GPS_SET_FREQUENCY_AIDING:
int i = 0;
char *buf;
- GSList *co_list;
CoreObject *co_network;
char *modem_name = NULL;
TcorePlugin *p = NULL;
if (!p)
return FALSE;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_NETWORK);
- if (!co_list) {
+ co_network = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK);
+ if (!co_network)
return FALSE;
- }
-
- co_network = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_network) {
- return FALSE;
- }
switch (command) {
case TRESP_NETWORK_SEARCH: {
struct custom_data *ctx = user_data;
gboolean pb_status = FALSE;
struct tel_phonebook_support_list *list = NULL;
- GSList *co_list = NULL;
CoreObject *co_pb = NULL;
TcorePlugin *plugin = NULL;
dbg("Func Entrance");
plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_list) {
- dbg("error- co_list is NULL");
- return FALSE;
- }
- co_pb = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
+ co_pb = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
if (!co_pb) {
dbg("error- co_pb is NULL");
return FALSE;
struct custom_data *ctx = user_data;
gint tmp_cardstatus = 0xff;
gboolean b_changed = FALSE;
- GSList *co_list = NULL;
CoreObject *co_sim = NULL;
TcorePlugin *plugin = NULL;
dbg("Func Entrance");
plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_list) {
- dbg("error- co_list is NULL");
- return FALSE;
- }
- co_sim = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
+ co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
if (!co_sim) {
dbg("error- co_sim is NULL");
return FALSE;
{
struct custom_data *ctx = user_data;
enum tel_sim_type type = SIM_TYPE_UNKNOWN;
- GSList *co_list = NULL;
CoreObject *co_sim = NULL;
TcorePlugin *plugin = NULL;
dbg("Func Entrance");
plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_list) {
- dbg("error- co_list is NULL");
- return FALSE;
- }
- co_sim = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
+ co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
if (!co_sim) {
dbg("error- co_sim is NULL");
return FALSE;
{
struct custom_data *ctx = user_data;
struct tel_sim_imsi *n_imsi;
- GSList *co_list = NULL;
CoreObject *co_sim = NULL;
TcorePlugin *plugin = NULL;
dbg("Func Entrance");
plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_list) {
- dbg("error- co_list is NULL");
- return FALSE;
- }
- co_sim = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
+ co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
if (!co_sim) {
dbg("error- co_sim is NULL");
return FALSE;
setSca.scaInfo.typeOfNum = arg_ton;
setSca.scaInfo.numPlanId = arg_npi;
- if ((setSca.scaInfo.dialNumLen <= 0) || (setSca.scaInfo.dialNumLen > (SMS_MAX_SMS_SERVICE_CENTER_ADDR + 1)))
- {
+ if ((setSca.scaInfo.dialNumLen <= 0)
+ || (setSca.scaInfo.dialNumLen > SMS_SMSP_ADDRESS_LEN)) {
err("[tcore_SMS] TAPI_API_INVALID_INPUT !!!");
return FALSE;
}
- else if(setSca.index != 0)
- {
+ else if(setSca.index != 0) {
err("[tcore_SMS] Index except 0 is supported");
// api_err = TAPI_API_NOT_SUPPORTED;
return FALSE;
- }
- else
- {
+ } else {
gsize length;
guchar *decoded_sca = NULL;
gpointer user_data)
{
struct custom_data *ctx = user_data;
- GSList *co_list = NULL;
CoreObject *co_sms = NULL;
TcorePlugin *plugin = NULL;
dbg("Func Entrance");
plugin = tcore_server_find_plugin(ctx->server, TCORE_PLUGIN_DEFAULT);
- co_list = tcore_plugin_get_core_objects_bytype(plugin, CORE_OBJECT_TYPE_SMS);
- if (!co_list) {
- dbg("error- co_list is NULL");
- return FALSE;
- }
-
- co_sms = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
+ co_sms = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SMS);
if (!co_sms) {
dbg("error- co_sms is NULL");
return FALSE;
gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
{
- GSList *co_list;
CoreObject *co_sms;
char *modem_name = NULL;
TcorePlugin *p = NULL;
if (!p)
return FALSE;
- co_list = tcore_plugin_get_core_objects_bytype(p, CORE_OBJECT_TYPE_SMS);
- if (!co_list) {
+ co_sms = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS);
+ if (!co_sms)
return FALSE;
- }
-
- co_sms = (CoreObject *)co_list->data;
- g_slist_free(co_list);
-
- if (!co_sms) {
- return FALSE;
- }
switch (command) {
case TRESP_SMS_SEND_UMTS_MSG: {