Open Stuermer opened 5 years ago
You're absolutely welcome.
Long story short: What you're trying to do is currently not possible with zugbruecke
, I am afraid.
In detail: zugbruecke
is state-less, i.e. does not maintain a state between function calls. Once the call into __read_ccd__
is done, zugbruecke
does not keep track of the pointer to _A
anymore. This problem falls within a larger category of other problems that I am currently trying to solve, which is unfortunately anything but trivial. From a design perspective, you just provided me with a good idea: I could enable you to tag/mark ctypes.pointer(_A)
as "state-full", so zugbruecke
does not drop it after a function call. I would have to add an API to the ctypes.pointer
-class, including a sync
method.
As a "workaround" in the meantime: You can write a simple Python script using the actual ctypes
module and run it with wine-python
, which is also provided by zugbruecke
. "All you have to do then" is to set up some inter-process-communication between your Linux-Python and wine-python
(Windows-Python on top of Wine). zugbruecke
offers a simple and robust RPC-layer for that.
Hi, first of all. This project is amazing! My use-case is calling win dlls for hardware where there is no linux library available (unfortunatly very common). In this case an ethernet camera.
Now my problem: I'm calling a DLL function that has a pointer argument and reads data from the camera. However, the function is non-blocking and doesn't change the data on return. I'm supposed to call a second function that 'waits' until the exposure time is done and the data has been written to buffer. But since there is no additional 'sync', the data doesn't get updated on the linux client.
In code:
`
` From what I understand from the documentation, the issue is that the memsync happens when the DLL function call __readccd_ returns. But that's not when the DLL actually changes the data. Is there a way to 'trigger' another sync on that memory address afterwards ?
Thanks!