}
static EDBus_Message *
-_properties_set(const EDBus_Service_Interface *iface, const char *propname, const EDBus_Message *msg)
+_properties_set(const EDBus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *msg)
{
EDBus_Message *reply;
- char *interface, *property, *type, *txt;
- EDBus_Message_Iter *variant;
+ char *type, *txt;
- if (!edbus_message_arguments_get(msg, "ssv", &interface, &property, &variant))
- {
- printf("Error on edbus_message_arguments_get()\n");
- return NULL;
- }
-
- type = edbus_message_iter_signature_get(variant);
+ type = edbus_message_iter_signature_get(iter);
if (type[0] != 's')
{
reply = edbus_message_error_new(msg, "org.freedesktop.DBus.Error.InvalidSignature",
}
reply = edbus_message_method_return_new(msg);
- edbus_message_iter_arguments_get(variant, "s", &txt);
+ edbus_message_iter_arguments_get(iter, "s", &txt);
printf("Resp2 was set to: %s, previously was: %s\n", txt, resp2);
free(type);
free(resp2);
EDBus_Service_Interface *iface;
Property *prop;
EDBus_Message *reply;
- EDBus_Message_Iter *main_iter;
+ EDBus_Message_Iter *variant;
EDBus_Property_Set_Cb setter = NULL;
- main_iter = edbus_message_iter_get(msg);
- if (!edbus_message_iter_get_and_next(main_iter, 's', &iface_name) ||
- !edbus_message_iter_get_and_next(main_iter, 's', &propname))
+ if (!edbus_message_arguments_get(msg, "ssv", &iface_name, &propname, &variant))
return NULL;
- dbus_message_iter_init(msg->dbus_msg,
- &main_iter->dbus_iterator);
-
iface = eina_hash_find(obj->interfaces, iface_name);
if (!iface)
return edbus_message_error_new(msg, DBUS_ERROR_UNKNOWN_INTERFACE,
return edbus_message_error_new(msg, DBUS_ERROR_PROPERTY_READ_ONLY,
"This property is read only");
- reply = setter(iface, propname, msg);
+ reply = setter(iface, propname, variant, msg);
return reply;
}
*
* @return Message of response, could be a simple method_return, error or NULL to send response later.
*/
-typedef EDBus_Message *(*EDBus_Property_Set_Cb)(const EDBus_Service_Interface *iface, const char *propname, const EDBus_Message *input_msg);
+typedef EDBus_Message *(*EDBus_Property_Set_Cb)(const EDBus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *input_msg);
typedef struct _EDBus_Method
{