Open AndySkaura opened 5 days ago
I successfully accessed the data within the pointer. The main issue in the code above is in let bits = new Uint8Array(4);
.
I suspect this object caused the pointer to become invalid. Changing it to let bits = [null]
solved the problem. Although the returned object appears empty, it is still a valid pointer. Using koffi.decode(bits[0], koffi.array('uint8', bitLength))
effectively retrieves the values.
Is it possible to add an object in JavaScript to simulate a pointer?
This is my Node.js calling code. In this code, bits is a pointer that is declared and assigned within the DLL. How can I access the raw data pointed to by this pointer in Node.js? I have reviewed the documentation but couldn’t find a way to access it.
Sorry, my English expression might be unclear. Thank you for providing the library, It helps me a lot.