summaryrefslogtreecommitdiffstats
path: root/tools/iio/iio_generic_buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* tools: iio: iio_generic_buffer: drop unneeded parenthesesEva Rachel Retuya2016-10-231-2/+2
| | | | | | | | | Remove extra parentheses introduced in commit <73e176a tools: iio: iio_generic_buffer: add -A to force-enable all channels>. Suggested-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_generic_buffer: rename and change type of force variableEva Rachel Retuya2016-10-231-4/+5
| | | | | | | | | Replace the type of 'force' flag from int to bool and at the same time rename it to 'force_autochannels' for better readability. Suggested-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_generic_buffer: add -A to force-enable all channelsEva Rachel Retuya2016-10-231-5/+12
| | | | | | | | | | | | | | If attribute/s is/are already enabled (by default or via scripts or manual interaction), issuing -a will fail to enable the channels thereby one has to manually disable the said attribute/s before proceeding with auto-enabling. Add a command-line option -A to force-activate all channels regardless of their current state. Suggested-by: Alison Schofield <amsfield22@gmail.com> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_generic_buffer: fix argument '?' optionMugunthan V N2016-09-221-1/+1
| | | | | | | | | | | | | | | | | When help ('?') option is passed to the command, the help text printed but not from '?' switch case of getopt_long() but as a invalid argument as below. Fix this by adding '?' to opt_String of getopt_long(). root@am437x-evm:~# ./iio_generic_buffer -? ./iio_generic_buffer: invalid option -- '?' Usage: generic_buffer [options]... Capture, convert and output data from IIO device buffer -a Auto-activate all available channels ... Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools:iio:iio_generic_buffer: fix trigger-less modeGregor Boirie2016-08-291-1/+1
| | | | | | | | | | | | | | | Passing the trigger-less mode option on the command line causes iio_generic_buffer to fail searching for an IIO trigger. Fix this by skipping trigger initialization if trigger-less mode is requested. Technically it actually fixes: 7c7e9dad70 where the bug was introduced but as the window to the patch below that changes the context was very small let's mark it with that. Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com> Fixes: deb4d1fdcb5af ("iio: generic_buffer: Fix --trigger-num option") Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: iio_generic_buffer: initialize channel array pointerAlison Schofield2016-08-151-1/+1
| | | | | | | | | | | | Uninitialized channel pointer causes segmentation fault when we call free(channel) during cleanup() with no channels initialized. This happens when you exit early for usage errors. Initialize the pointer to NULL when it is declared. Signed-off-by: Alison Schofield <amsfield22@gmail.com> Cc: Daniel Baluta <daniel.baluta@gmail.com> Tested-by: Gregor Boirie <gregor.boirie@parrot.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: generic_buffer: Fix --trigger-num optionCrestez Dan Leonard2016-06-111-2/+2
| | | | | | | | Initialize trig_num to -1 and handle trig_num=0 as a valid id. Fixes: 7c7e9dad (iio: iio_generic_buffer: Add --trigger-num option) Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: iio_generic_buffer: Add --trigger-num optionCrestez Dan Leonard2016-05-291-5/+29
| | | | | Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: iio_generic_buffer: Add --device-num optionCrestez Dan Leonard2016-05-291-18/+51
| | | | | | | | This makes it possible to distinguish between iio devices with the same name. Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: iio_generic_buffer: Cleanup when receiving signalsCrestez Dan Leonard2016-05-291-64/+108
| | | | | | | | | | | | | This will clean (disable buffer/trigger/channels) when doing something like a CTRL-C. Otherwise restarting generic_buffer requires a manual echo 0 > buffer/enable This also cleanup up all the code freeing string buffers at the end of main. We initialize all pointers to NULL so that cleanup can all be done under a single error label. Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* tools: iio: Rename generic_buffer to iio_generic_bufferDaniel Baluta2016-05-291-0/+581
This makes it clear that generic_buffer is an IIO tool and also complies with filename conventions in tools/iio. Signed-off-by: Daniel Baluta <daniel.baluta@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
OpenPOWER on IntegriCloud