You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, wouldnt it be helpful to have a helper method to parse the properties changed signal?
PropertiesChanged(s interface_name, {sv} changed_properties, as invalidated_properties):
interface_name: name of the interface on which the properties are defined
changed_properties: changed properties with new values
invalidated_properties: changed properties but the new values are not send with them
something like:
func (d *dbusBase) parsePropertiesChanged(v *dbus.Signal) (interfaceName string, changedProperties map[string]dbus.Variant, invalidatedProperties []string, err error) {
if len(v.Body )!= 3{
err = errors.New("error by parsing property changed signal")
return
}
interfaceName, ok := v.Body[0].(string)
if !ok {
err = errors.New("error by parsing interface name")
return
}
changedProperties, ok = v.Body[1].(map[string]dbus.Variant)
if !ok {
err = errors.New("error by parsing changed properties map name")
return
}
invalidatedProperties, ok = v.Body[2].([]string)
if !ok {
err = errors.New("error by parsing invalidated properties")
return
}
return
}
The text was updated successfully, but these errors were encountered:
Introducing a new type PropertiesChanged that conforms to the
PropertiesChanged signal body fields. The Signal type will now
have a func that parsed the Signal body and return the new type.
Included some supporting functionality for PropertiesChanged to
check for and get changed properties.
Addresses godbus#201
Hi, wouldnt it be helpful to have a helper method to parse the properties changed signal?
something like:
The text was updated successfully, but these errors were encountered: