Skip to content

Commit

Permalink
Add missing c_uint type for several python/c bindings
Browse files Browse the repository at this point in the history
Errors are being thrown from the python bindings to IIO. Function prototypes for d_get_attr, d_get_debug_attr, d_get_buffer_attr, c_get_attr are missing an additional argument, that is currently not being passed and causes strange OS errors, since the expected parameter is not passed.

This commit adds the missing c_uint parameter to these python/C bindings and fixes the issue for these specific functions.

Signed-off-by: Misko <misko@cs.toronto.edu>
  • Loading branch information
misko authored and pcercuei committed Oct 19, 2022
1 parent cee2d13 commit 1246cb0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bindings/python/iio.py
Expand Up @@ -375,7 +375,7 @@ class ChannelType(Enum):

_d_get_attr = _lib.iio_device_get_attr
_d_get_attr.restype = c_char_p
_d_get_attr.argtypes = (_DevicePtr,)
_d_get_attr.argtypes = (_DevicePtr, c_uint)
_d_get_attr.errcheck = _check_null

_d_read_attr = _lib.iio_device_attr_read
Expand All @@ -394,7 +394,7 @@ class ChannelType(Enum):

_d_get_debug_attr = _lib.iio_device_get_debug_attr
_d_get_debug_attr.restype = c_char_p
_d_get_debug_attr.argtypes = (_DevicePtr,)
_d_get_debug_attr.argtypes = (_DevicePtr, c_uint)
_d_get_debug_attr.errcheck = _check_null

_d_read_debug_attr = _lib.iio_device_debug_attr_read
Expand All @@ -413,7 +413,7 @@ class ChannelType(Enum):

_d_get_buffer_attr = _lib.iio_device_get_buffer_attr
_d_get_buffer_attr.restype = c_char_p
_d_get_buffer_attr.argtypes = (_DevicePtr,)
_d_get_buffer_attr.argtypes = (_DevicePtr, c_uint)
_d_get_buffer_attr.errcheck = _check_null

_d_read_buffer_attr = _lib.iio_device_buffer_attr_read
Expand Down Expand Up @@ -506,7 +506,7 @@ class ChannelType(Enum):

_c_get_attr = _lib.iio_channel_get_attr
_c_get_attr.restype = c_char_p
_c_get_attr.argtypes = (_ChannelPtr,)
_c_get_attr.argtypes = (_ChannelPtr, c_uint)
_c_get_attr.errcheck = _check_null

_c_get_filename = _lib.iio_channel_attr_get_filename
Expand Down

0 comments on commit 1246cb0

Please sign in to comment.