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

Implement working SWIG bindings for ASIGetSerialNumber, ASIGetID, ASISetID #44

Open
jgottula opened this issue Jan 2, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@jgottula
Copy link
Collaborator

jgottula commented Jan 2, 2020

We very likely need these bindings for camera selection logic. The current auto-generated ones don't work and just segfault Python.

Based on initial investigations, it will probably take hundreds of man-hours to figure out how the hell to pass eight bytes between Python and a C function.

@jgottula
Copy link
Collaborator Author

jgottula commented Jan 2, 2020

Like I could literally do this much faster in raw x86-64 assembly code.

ASIGetID/ASIGetSerialNumber
Put camera ID in rdi. Put pointer to 8-byte destination buffer in rsi. Call the function. Error code is now in rax. Destination buffer now contains ID or SN bytes if the call was successful. Done.

ASISetID
Put camera ID in rdi. Put pointer to 8-byte source buffer in rsi. Call the function. Error code is now in rax. Done.

🤦‍♂️

Why does everything suck

@bgottula
Copy link
Collaborator

bgottula commented Nov 8, 2020

We've managed to avoid needing these functions since we can distinguish between cameras purely by reading their names.

If we do decide we still want these and SWIG is too painful we could consider replacing SWIG bindings with something like pybind11: https://pybind11.readthedocs.io/en/stable/

@bgottula bgottula added the enhancement New feature or request label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants