android - Converting a IntPtr bluetooth socket instance to a native monodroid BlueToothSocket? -
i'm using jni intptr bluetooth connection method. code is:
intptr createrfcommsocket = jnienv.getmethodid(device.class.handle, "createrfcommsocket", "(i)landroid/bluetooth/bluetoothsocket;"); intptr socket = jnienv.callobjectmethod(device.handle, createrfcommsocket, new jvalue(1)); is there anyway convert intptr socket native monodroid bluetoothsocket?
i need offer single interface create bluetooth socket method.
is there anyway convert intptr socket native monodroid bluetoothsocket?
if "native monodroid bluetoothsocket" mean bluetoothsocket, use java.lang.object.getobject<t>() method:
var msocket = java.lang.object.getobject<android.bluetooth.bluetoothsocket>(socket, jnihandleownership.transferlocalref);
Comments
Post a Comment