Following up on my previous post (which I resolved), I'm stuck on another native function in this library for which I cannot figure out how to do the binding:
typedef Handle void;
Handle handle
int res = getHandle("myDevice", &handle);
My dart code looks like:
typedef Handle = Void;
typedef getHandle_native_t = Int32 Function(Pointer<Utf8> name, Pointer<Void> handle);
late int Function(Pointer<Utf8> name, Pointer<Void> handle) getHandle;
getHandle = library
.lookup<NativeFunction<getHandle_native_t>>('getHandle')
.asFunction();
// Here I'm stuck, how do I get an initialized "handle'?
Pointer<Handle> handlePointer = calloc(); // this compiles
String name = "myDevice";
int res = getHandle(name.toNativeUtf8(), handlePointer);
Handle handle = handlePointer.value; // compile error, no such property 'value'. "ref" doesn't exist either as a property...
How do I get to the "void" value? I need this value to pass to subsequent function calls...
Maarten