Skip to content

Commit

Permalink
python: fixed Channel.convert() method.
Browse files Browse the repository at this point in the history
c_void_p(*dst) and c_void_p(*src) were not properly creating a pointer to dst and src.

Signed-off-by: Cristi Iacob <[email protected]>
  • Loading branch information
cristi-iacob committed Apr 29, 2020
1 parent 06060b8 commit 848f9f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bindings/python/iio.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Lesser General Public License for more details.

from ctypes import Structure, c_char_p, c_uint, c_int, c_long, c_longlong, c_size_t, \
c_ssize_t, c_char, c_void_p, c_bool, create_string_buffer, c_double, \
c_ssize_t, c_char, c_void_p, c_bool, create_string_buffer, c_double, cast, \
POINTER as _POINTER, CDLL as _cdll, memmove as _memmove, byref as _byref
from ctypes.util import find_library
from enum import Enum
Expand Down Expand Up @@ -816,7 +816,9 @@ def convert(self, dst, src):
src: type=list
Data to be converted.
"""
_channel_convert(self._channel, c_void_p(*dst), c_void_p(*src))
src_ptr = cast((c_char * (len(src) * self.data_format.length))(*src), c_void_p)
dst_ptr = cast((c_char * (len(dst) * self.data_format.length))(*dst), c_void_p)
_channel_convert(self._channel, src_ptr, dst_ptr)

class Buffer(object):

Expand Down

0 comments on commit 848f9f9

Please sign in to comment.