analogdevicesinc / libiio

A cross platform library for interfacing with local and remote Linux IIO devices
http://analogdevicesinc.github.io/libiio/
GNU Lesser General Public License v2.1
471 stars 309 forks source link

Increase attribute read buffer space #1157

Closed hannesweisbach closed 3 months ago

hannesweisbach commented 3 months ago

PR Description

When reading an attribute a buffer of size 1024 bytes is used by the python bindings of libiio (iio.py:762). This is not enough space for large attributes, such as gain_table_config of an AD9361 ('ad9361-phy'), which is 1688 bytes. This PR increases the buffer size to 4096 bytes.

This is a bit of a brute-force solution. Ideally, iiod would be able to inform the caller of the required buffer space, or the caller could use an incrementally growing buffer. I think the simple solution of using a larger buffer is ok though.

PR Type

PR Checklist

mhennerich commented 3 months ago

DCO with USER@users.noreply.github.com does not qualify - we need a proper email address which doesn't bounce!

hannesweisbach commented 3 months ago

I used the Github Web-IDE to make this change. I didn't even notice the mail address (I think it was even just a checkbox?). How do I fix it?

mhennerich commented 3 months ago

I used the Github Web-IDE to make this change. I didn't even notice the mail address (I think it was even just a checkbox?). How do I fix it?

Welll, it's already merged - so without rewriting the history we can't fix the commit. Please provide your signed-off-by tag here ...

hannesweisbach commented 3 months ago

Signed-off by: Hannes Weisbach weisbach@neosat.de

mhennerich commented 3 months ago

Thanks!

hannesweisbach commented 3 months ago

No worries. I guess I won't use the Web IDE in the future, though ...