kind of working!
This commit is contained in:
parent
20f69ca0aa
commit
c0dfb6370e
3 changed files with 31 additions and 24 deletions
|
|
@ -37,21 +37,25 @@ class ClientController extends Notifier<int> {
|
|||
|
||||
GomuksStart(
|
||||
handle,
|
||||
Pointer.fromFunction<
|
||||
Void Function(Pointer<Char>, Int64, GomuksBorrowedBuffer)
|
||||
>(gomuksCallback),
|
||||
NativeCallable<
|
||||
Void Function(Pointer<Char>, Int64, GomuksBorrowedBuffer)
|
||||
>.listener(gomuksCallback)
|
||||
.nativeFunction,
|
||||
);
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
Map<String, dynamic> sendCommand(String command, Map<String, dynamic> data) {
|
||||
final bufferPointer = data.toGomuksBufferPtr();
|
||||
final response = GomuksSubmitCommand(
|
||||
state,
|
||||
command.toNativeUtf8().cast<Char>(),
|
||||
data.toGomuksBuffer(),
|
||||
bufferPointer.ref,
|
||||
);
|
||||
|
||||
calloc.free(bufferPointer);
|
||||
|
||||
return response.buf.toJson();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue