<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi Dave,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I did include the sample code in my previous mail. </DIV>
<DIV>&nbsp;</DIV>
<DIV><A href="http://www.gossamer-threads.com/lists/maemo/developers/61353">http://www.gossamer-threads.com/lists/maemo/developers/61353</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>I am including the code again for your reference:</DIV>
<DIV>I am getting the error "<U>HAL context initializing failure</U>" in my below code</DIV>
<DIV>When i debug the code it says unable to access memory at 0x0.</DIV>
<DIV><BR><BR>Code: <BR><BR>DBusConnection *connection; <BR>DBusError error; <BR>LibHalContext *ctx; <BR>dbus_error_init(&amp;error); <BR>if((connection = dbus_bus_get(DBUS_BUS_SYSTEM,&amp;error)) == NULL) <BR>{ <BR>printf("Error %s\n",error.message); <BR>return 1; <BR>} <BR>if ( dbus_error_is_set(&amp;error) ) <BR>{ <BR>printf("Unable to connect to DBus: %s\n",error.message); <BR>return 1; <BR>} <BR>if((ctx = libhal_ctx_new())==NULL) <BR>{ <BR>printf("Error %s\n",error.message); <BR>return 1; <BR>} <BR>if ( !libhal_ctx_set_dbus_connection(ctx, connection) ) <BR>{ <BR>printf("Error %s\n",error.message); <BR>return 1; <BR>} <BR>if ( !libhal_ctx_init(ctx, &amp;error) ) <BR>{ <BR>printf("Hal context initializing failure %s\n",error.message); <BR>return 1; <BR>} </DIV>
<DIV>else</DIV>
<DIV>{</DIV>
<DIV>&nbsp;&nbsp; printf("Success");</DIV>
<DIV>&nbsp;&nbsp; return 0;</DIV>
<DIV>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks &amp; Regards.</DIV></td></tr></table><br>