Пример #1
0
func propInt64(path dbus.ObjectPath, prop string) (int64, error) {
	v, err := device.GetProperty(path, prop)
	if err != nil {
		return 0, err
	}
	x, ok := v.Value().(int64)
	if !ok {
		return 0, fmt.Errorf("not int64")
	}
	return x, nil
}
Пример #2
0
func propUint32(path dbus.ObjectPath, prop string) (uint32, error) {
	v, err := device.GetProperty(path, prop)
	if err != nil {
		return 0, err
	}
	x, ok := v.Value().(uint32)
	if !ok {
		return 0, fmt.Errorf("not uint32")
	}
	return x, nil
}