Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bus: Pass object name to the signal handler
This is quite helpful to find out the object whose properties have changed. Tested with NetworkManager: ```lua local dbus = require("easydbus") local bus = dbus.system() local function properties_changed(interface, changed, invalidated, path) local next = next print(("[ %s ]"):format(interface)) print((" Path = %s"):format(path)) if next(changed) ~= nil then print(" Changed:") for k, v in pairs(changed) do print((" %s = %s"):format(k, v)) end end if next(invalidated) ~= nil then print(" Invalidated:") for _, v in pairs(invalidated) do print((" %s"):format(v)) end end end bus:subscribe(nil, nil, "org.freedesktop.DBus.Properties", "PropertiesChanged", properties_changed) dbus.mainloop() ``` For example: ``` [ org.freedesktop.NetworkManager.AccessPoint ] Path = /org/freedesktop/NetworkManager/AccessPoint/24 Changed: Strength = 87 ```
- Loading branch information