2

I am trying to modify some code using systemd dbus.

The method call looks like this:

res = sd_bus_call_method(bus, SERVICE_NAME, OBJECT_PATH, INTERFACE, "AddData", &error, &m, "ss", data->key, data->valyue); 

Now I'm trying to change that to:

res = sd_bus_call_method(bus, SERVICE_NAME, OBJECT_PATH, INTERFACE, "AddData", &error, &m, "(a(ss))", /* WHAT DO I PASS HERE? */); 

I can't find examples or documentation and the code is not super clear to me.

1 Answer 1

6

From documentation sd_bus_call_method

sd_bus_call_method() is a convenience function for initializing a bus message object and calling the corresponding D-Bus method. It combines the sd_bus_message_new_method_call(3), sd_bus_message_append(3) and sd_bus_call(3) functions into a single function call.

Details about parameters can be found on sd_bus_message_append().

res = sd_bus_call_method(bus, SERVICE_NAME, OBJECT_PATH, INTERFACE, "AddData", &error, &m, "(a(ss))", 1, /* size of array */ "hello", "world"); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.