On Di, 16.01.18 15:41, Tomasz Michalski ([email protected]) wrote: > Handler: > int propertiesChangedHandler(sd_bus_message *message, void *userdata, > sd_bus_error *error) > { > const char *data; > const char *path; > int r = 0; > > if(!message) > printf("Empty message provided\n"); > > path = sd_bus_message_get_path(message); > if (!path) > { > printf("Empty message provided\n"); > return 0; > } > > r = sd_bus_message_read(message, "s", &data); //here problem with > parsing ActiveState,SubState
The PropertiesChanged signal sends a more complex data struct back. For details see the D-Bus spec: https://dbus.freedesktop.org/doc/dbus-specification.html It's a bit nasty to parse that out, but doable. > Question: > How to narrow down filter? In the above examples the handler will be > triggered by any property change. I am only interested in ActiveState, > eventually SubState trigger. Should I add in sd_bus_add_match: > "arg1='ActiveState'", > "arg2='SubState'" > ? Unfortunately D-bus does not allow such finegrained matches. You cannot look inside of arrays or dicts with them. Lennart -- Lennart Poettering, Red Hat _______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
