Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Maemo: Developers

looking for help with dbus_g_proxy_call

 

 

Maemo developers RSS feed   Index | Next | Previous | View Threaded


jfwfreo at tpgi

Oct 26, 2011, 2:58 AM

Post #1 of 2 (406 views)
Permalink
looking for help with dbus_g_proxy_call

This code:
#define PHONE_SIM_SERVICE "com.nokia.phone.SIM"
#define PHONE_SIM_PATH "/com/nokia/phone/SIM"
#define PHONE_SIM_IFACE "Phone.Sim"
#define GET_SERVICE_PROVIDER_NAME "get_service_provider_name"

DBusGProxy *dbus_g_proxy = NULL;
dbus_g_proxy = dbus_g_proxy_new_for_name(plugin->priv->dbus_conn,
PHONE_SIM_SERVICE, PHONE_SIM_PATH, PHONE_SIM_IFACE);
if(dbus_g_proxy)
{
gchar *operator_name = NULL;
guint32 val1;
guint32 val2;
gint32 val3;
if(dbus_g_proxy_call(dbus_g_proxy, GET_SERVICE_PROVIDER_NAME, NULL,
G_TYPE_INVALID, G_TYPE_STRING, &operator_name, G_TYPE_UINT, &val1,
G_TYPE_UINT, &val2, G_TYPE_INT, &val3))
{
if ((operator_name != 0) && (operator_name[0] != 0))
{
free(plugin->priv->operator_name);
plugin->priv->operator_name = strdup(operator_name);
g_free(operator_name);
g_object_unref(dbus_g_proxy);
return;
}
}
g_object_unref(dbus_g_proxy);
}

should be doing the same as this:
dbus-send --system --type=method_call --print-reply
--dest=com.nokia.phone.SIM /com/nokia/phone/SIM
Phone.Sim.get_service_provider_name

dbus_g_proxy is initialized to a valid value but the dbus_g_proxy_call call
is failing. I can confirm that the dbus-send command outputs valid output
on my device, I just cant figure out why my dbus_g_proxy_call call is failing.


_______________________________________________
maemo-developers mailing list
maemo-developers [at] maemo
https://lists.maemo.org/mailman/listinfo/maemo-developers


nicolaihess at web

Oct 26, 2011, 3:20 AM

Post #2 of 2 (391 views)
Permalink
Re: looking for help with dbus_g_proxy_call [In reply to]

2011/10/26 Jonathan Wilson <jfwfreo [at] tpgi>

> This code:
> #define PHONE_SIM_SERVICE "com.nokia.phone.SIM"
> #define PHONE_SIM_PATH "/com/nokia/phone/SIM"
> #define PHONE_SIM_IFACE "Phone.Sim"
> #define GET_SERVICE_PROVIDER_NAME "get_service_provider_name"
>
> DBusGProxy *dbus_g_proxy = NULL;
> dbus_g_proxy = dbus_g_proxy_new_for_name(**plugin->priv->dbus_conn,
> PHONE_SIM_SERVICE, PHONE_SIM_PATH, PHONE_SIM_IFACE);
> if(dbus_g_proxy)
> {
> gchar *operator_name = NULL;
> guint32 val1;
> guint32 val2;
> gint32 val3;
> if(dbus_g_proxy_call(dbus_g_**proxy,
> GET_SERVICE_PROVIDER_NAME, NULL, G_TYPE_INVALID, G_TYPE_STRING,
> &operator_name, G_TYPE_UINT, &val1, G_TYPE_UINT, &val2, G_TYPE_INT, &val3))
> {
> if ((operator_name != 0) && (operator_name[0] != 0))
> {
> free(plugin->priv->operator_**name);
> plugin->priv->operator_name =
> strdup(operator_name);
> g_free(operator_name);
>
> g_object_unref(dbus_g_proxy);
> return;
> }
> }
> g_object_unref(dbus_g_proxy);
> }
>
> should be doing the same as this:
> dbus-send --system --type=method_call --print-reply
> --dest=com.nokia.phone.SIM /com/nokia/phone/SIM Phone.Sim.get_service_**
> provider_name
>
> dbus_g_proxy is initialized to a valid value but the dbus_g_proxy_call call
> is failing. I can confirm that the dbus-send command outputs valid output on
> my device, I just cant figure out why my dbus_g_proxy_call call is failing.
>
>
> ______________________________**_________________
> maemo-developers mailing list
> maemo-developers [at] maemo
> https://lists.maemo.org/**mailman/listinfo/maemo-**developers<https://lists.maemo.org/mailman/listinfo/maemo-developers>
>

You missed one G_TYPE_INVALID:
instead of this line:
dbus_g_proxy_call(dbus_g_p
roxy, GET_SERVICE_PROVIDER_NAME, NULL, G_TYPE_INVALID, G_TYPE_STRING,
&operator_name, G_TYPE_UINT, &val1, G_TYPE_UINT, &val2, G_TYPE_INT, &val3)
use this:
dbus_g_proxy_call(dbus_g_p
roxy, GET_SERVICE_PROVIDER_NAME, NULL, G_TYPE_INVALID, G_TYPE_STRING,
&operator_name, G_TYPE_UINT, &val1, G_TYPE_UINT, &val2, G_TYPE_INT, &val3,
G_TYPE_INVALID)

Maemo developers RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.