I am trying to call CPP function from NodeJS
typedef struct foo {
uint8_t *data;
int dataSize;
} foo ;
foo *ExtractBar(const int16_t *bar);
I have tried nbind library in NodeJS. but getting unbound type error.
uint16 = Int16Array.from('12345');
uint16.fill(0);
lib.ExtractBar(uint16);
I have also tried ffi-napi npm module. but from that I was getting segmentation fault error. can anyone help me please on how to pass correct argument from NodeJS code. I am not sure how to create similar structure in NodeJS-
const int16_t *bar