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
iio_attr: make dealing with devices with no name easier.
----------
I've been through libiio on devices with no name
It felt good to be out of the rain
In the libiio you don't need remember your name
'Cause there ain't no one for to give you no pain
apologies Dewey Bunnell
-----------
Some properly formed iio devices have no name attribute, so don't force
people to use a name when refering to them.
Now when you find devices like this (no name), you can refer to things
by the ID.
$ ./tests/iio_attr -u ip:192.168.1.120 -d
IIO context has 7 devices:
iio:device1, ad9361-phy: found 18 device attributes
iio:device3, cf-ad9361-dds-core-lpc: found 0 device attributes
iio:device4, cf-ad9361-lpc: found 0 device attributes
iio_sysfs_trigger: found 2 device attributes
trigger0, sysfstrig1: found 1 device attributes
iio ID and name can be used interchangeably
$ ./tests/iio_attr -u ip:192.168.1.120 -d iio:device2
dev 'xadc', attr 'sampling_frequency', value :'961538'
$ ./tests/iio_attr -u ip:192.168.1.120 -d xadc
dev 'xadc', attr 'sampling_frequency', value :'961538'
And when there is no name at all, you can just use the ID.
$ ./tests/iio_attr -u ip:192.168.1.120 -d iio_sysfs_trigger
dev 'iio_sysfs_trigger', attr 'add_trigger', value :ERROR: Unknown error 13 (-13)
dev 'iio_sysfs_trigger', attr 'remove_trigger', value :ERROR: Unknown error 13 (-13)
devices which are triggers will show up as triggers:
./tests/iio_attr -u ip:192.168.1.120 -d sysfstrig1
trig 'sysfstrig1', attr 'trigger_now', value :ERROR: Unknown error 13 (-13)
Signed-off-by: Robin Getz <[email protected]>
0 commit comments