C++ third party library function
int getUCode( char* sample, int* size);
Usage
char Code[256] = {0};
length = sizeof(Code);
ret = getUCode(Code, &length);
Trying to Call above getUCode function using ffi-napi. But getting empty buffer.
const charPointer = ref.refType('char')
"getUCode": [
"int32", [charPointer ,"int32"]
var str = Buffer.alloc(256)
var Len = 256
var val = lib.getUCode(str,Len);
We can use ref.refType to tell integer pointer in function signature
Use Buffer to pass actual value in function calls