We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello guys,
To begin, thanks for your awesome library :D.
I works libphoto2 integration inside nodejs module, and one the function used by libphoto2 require a complex structure like that:
typedef struct _CameraFileHandler { // int (*size) (uint64_t *size); /* only for read? */ int (*read) ( unsigned char *data, uint64_t *len); // int (*write) ( unsigned char *data, uint64_t *len); } CameraFileHandler;
I tried to define a StructType like that:
const {refType} = require("ref"); const RefCB = refType("void"); const ffi = require("ffi-napi"); const StructCameraFileHandler = StructType({ read: RefCB }); const driver = ffi.Library("libgphoto2", { gp_file_new_from_handler: ["int", [refType(StructCameraFileHandler)]], }); const file = new StructCameraFileHandler(); file.read = ffi.Callback("int", [StructPriv, types.CString, "int"], (data, length) => { console.log(data, length); }); driver.gp_file_new_from_handler(file.ref());
But, my callback is never called. I'm not sure if the structure is correctly configured with ffi and ref-struct. Do you have any idea ?
Thanks in advance ;) See you, Romain
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello guys,
To begin, thanks for your awesome library :D.
I works libphoto2 integration inside nodejs module, and one the function used by libphoto2 require a complex structure like that:
I tried to define a StructType like that:
But, my callback is never called. I'm not sure if the structure is correctly configured with ffi and ref-struct.
Do you have any idea ?
Thanks in advance ;)
See you,
Romain
The text was updated successfully, but these errors were encountered: