ProxyObject & error verification in D-Bus Method Calls

sumeet.pawnikar at wipro.com sumeet.pawnikar at wipro.com
Thu May 29 08:34:45 PDT 2008


 
Hi All,
 
I have written the D-Bus Server Side Code.
I have implemented the D-Bus methods and signals.
 
In Any D-Bus method call, I have to provide the first argument of that
method call is ProxyObject.
Also, one of the argument is GError error.
 
But, in the defination ( implementation ) of this D-Bus method call, I
am not using these two parameters : ProxyObject , error.
 
gboolean D-Bus_method_call ( DBusGPRoxy* PRoxyObject, guchar* RetStatus,
GError* error )
{
 
}
 
 
When I make using warning flags set, 
it gives the below warnings which is related to the "D-Bus Proxy Object
and error " at some locations, 
 
 
file.c: In function 'D-Bus method call":
file.c:22: warning: unused parameter 'proxyObj'
file.c:22: warning: unused parameter 'error'

 
Because thesse are the D-Bus method calls parameters and these method
calls require this "proxy object".
 
Should we remove these warnings ?
 
I have one fix for this as below : 
 
As soon as I entered the D-Bus method call, I will check ProxyObject
using below api :
gboolean D-Bus_method_call ( DBusGPRoxy* PRoxyObject, guchar* RetStatus,
GError* error )
{
g_return_val_if_fail (DBUS_IS_G_PROXY (ProxyObject), FALSE);    // FALSE
is return value of D-Bus method
dbus_error_init (error);
if (dbus_error_is_set (error))     // checking the error is set or not

{
        printf ("%s\n", error);
        dbus_error_free (error);
}
return TRUE; 
}
Pls, correct me if I am wrong anywhere ? Or let me know this approach is
correct.
 
 
Thanks and Regards,
Sumeet Pawnikar
 
The future belongs to those who believe in the beauty of their dreams.
 
 

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. 

www.wipro.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/dbus/attachments/20080529/20c6e0f4/attachment.html 


More information about the dbus mailing list