Hi,<br><br>I compiled hal.0.5.10 on my system...<br>I can call methods registered on the Dbus at org.freedesktop.Hal.Manager&nbsp;&nbsp; --- like GetAllDevices. And get the list of all device connected to the system at that time.<br>
But I am not able to get the signal&nbsp; DeviceAdded&nbsp; through DBus....<br><br>Below is the code i use to listen to the signal<br><br><br>con=dbus_g_bus_get(DBUS_BUS_SYSTEM,NULL);<br>&nbsp;&nbsp;&nbsp;&nbsp; proxy=dbus_g_proxy_new_for_name(con,&quot;
org.freedesktop.Hal&quot;,&quot;/org/freedesktop/Hal/Manager&quot;,&quot;org.freedesktop.Hal.Manager&quot;);<br><br>&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;Probably got a connectrion to the correct interface...\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp; loop=g_main_loop_new(NULL,FALSE);
<br>&nbsp;&nbsp;&nbsp;&nbsp; m1=g_cclosure_user_marshal_VOID__STRING;<br>&nbsp;&nbsp;&nbsp;&nbsp; m2=g_cclosure_user_marshal_VOID__STRING;<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_object_register_marshaller(m1,G_TYPE_BOOLEAN,G_TYPE_STRING,G_TYPE_INVALID);<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_object_register_marshaller(m2,G_TYPE_BOOLEAN,G_TYPE_STRING,G_TYPE_INVALID);
<br><br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_proxy_add_signal(proxy,&quot;DeviceAdded&quot;,G_TYPE_INVALID);<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_proxy_add_signal(proxy,&quot;DeviceRemoved&quot;,G_TYPE_INVALID);<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_proxy_connect_signal(proxy,&quot;DeviceAdded&quot;,(GCallback)device_added,NULL,NULL);
<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_proxy_connect_signal(proxy,&quot;DeviceRemoved&quot;,(GCallback)device_removed,NULL,NULL);<br><br>&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;Calling a remote method...\n&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp; err=NULL;<br>&nbsp;&nbsp;&nbsp;&nbsp; dbus_g_proxy_call(proxy,&quot;GetAllDevices&quot;,&amp;err,G_TYPE_INVALID,G_TYPE_STRV,&amp;list,G_TYPE_INVALID);
<br><br><br><br>I am not able to determine what the problem...&nbsp; Do i have to edit any policy files for this?? Or my code is wrong??<br>{I am trying to get DeviceAdded signal whner i connect my flash stick}<br>Any suggestion on this is appreciated....
<br>Thanks in advance .<br><br>shankar<br><br>