Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update app resource APIs to accept void* #19

Merged
merged 2 commits into from
Jun 22, 2022

Conversation

m-mead
Copy link
Collaborator

@m-mead m-mead commented Jun 2, 2022

The function signatures for the C store/load app resources APIs
accept a void* for the data parameter. However, the Python language
bindings were passing an array of bytes without performing casting.
This resulted in a TypeError exception being raised.

Signed-off-by: Michael Mead mmead.developer@gmail.com

The function signatures for the C store/load app resources APIs
accept a `void*` for the `data` parameter. However, the Python language
bindings were passing an array of bytes without performing casting.
This resulted in a `TypeError` exception being raised.

Signed-off-by: Michael Mead <mmead.developer@gmail.com>
@m-mead m-mead requested review from tmullanix and WDombrowski June 2, 2022 04:35
@m-mead m-mead added the fix label Jun 2, 2022
@m-mead m-mead marked this pull request as draft June 2, 2022 04:40
@tmullanix
Copy link
Collaborator

The call is missing the data_size.

seekcamera_load_app_resources

_cdll.seekcamera_load_app_resources.restype = ctypes.c_int32
_cdll.seekcamera_load_app_resources.argtypes = [
ctypes.c_void_p,
ctypes.c_int32,
ctypes.POINTER(ctypes.c_void_p),
ctypes.c_size_t,
_SEEKCAMERA_MEMORY_ACCESS_CALLBACK_T,
ctypes.py_object,
]

After I fixed this and used the enums instead of 0, 1, and 2 for the regions (the enums are 11, 12, and 13:0) it worked!

The C API `seekcamera_load_app_resources` takes a `data_size` parameter
to indicate the size of the input buffer.

Signed-off-by: Michael Mead <mmead.developer@gmail.com>
@m-mead m-mead requested a review from tmullanix June 3, 2022 05:16
@m-mead m-mead marked this pull request as ready for review June 3, 2022 05:16
@swengseekthermal swengseekthermal merged commit cb01e94 into main Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants