linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* read /dev/iio:device0 return -1 (Invalid argument)
@ 2015-12-12  8:36 Julio Cruz
  2015-12-12 11:51 ` Jonathan Cameron
  0 siblings, 1 reply; 16+ messages in thread
From: Julio Cruz @ 2015-12-12  8:36 UTC (permalink / raw)
  To: linux-iio

Hi,

I get an error trying to read /dev/iio:device0 in a custom application
(C/C++), however in a terminal the command "cat /dev/iio_device0"
return data.

Below the procedure:

- enable channels
- setup trigger
- setup buffer lenght
- enable buffer (the SPI interrupt is setup properly and all the
trigger handler are done)
- read /dev/iio_device0

It's a SPI device acquiring 27 bytes @ 1KHz.

Results:

1. Custom application (based on generic_buffer.c): function 'read'
return -1 and strerror(errno) return "Invalid argument"
2. iio_readdev (libiio): show the message "Unable to refill buffer:
Input/output error"
3. In terminal, the command "cat /dev/iio_device0" show values (no
readable) while the buffer is enable.

Any suggestion?

Thanks for your help!

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-01-06 18:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12  8:36 read /dev/iio:device0 return -1 (Invalid argument) Julio Cruz
2015-12-12 11:51 ` Jonathan Cameron
     [not found]   ` <CAAn_ec_=9syP4j+g5GRMCB-+7vCWE1XqryE6KWUm=auUBZE=uQ@mail.gmail.com>
2015-12-12 12:35     ` Jonathan Cameron
2015-12-12 12:41       ` Julio Cruz
2015-12-13 10:44         ` Julio Cruz
2015-12-13 12:14           ` Jonathan Cameron
2015-12-13 14:42             ` Julio Cruz
2015-12-13 15:21               ` Jonathan Cameron
2016-01-04  4:59                 ` Julio Cruz
2016-01-04 11:34                   ` Jonathan Cameron
2016-01-04 12:29                     ` Daniel Baluta
2016-01-04 12:46                     ` Lars-Peter Clausen
2016-01-04 18:22                       ` Jonathan Cameron
2016-01-05 11:57                         ` Julio Cruz
2016-01-06 18:27                           ` Jonathan Cameron
2016-01-06 18:59                             ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).