diff --git a/WiiUseJC/wiiusej_WiiUseApi.c b/WiiUseJC/wiiusej_WiiUseApi.c index 4fad079..b1d3b77 100644 --- a/WiiUseJC/wiiusej_WiiUseApi.c +++ b/WiiUseJC/wiiusej_WiiUseApi.c @@ -377,6 +377,24 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setNunchukAccelerationThreshold wiiuse_set_nunchuk_accel_threshold(wiiuse_get_by_id(wiimotes, nbMaxWiimotes, id), val); } +/** + * Force the bluetooth stack type.(useful only for windows) + * + * @param bluetoothStackType + * must be WiiUseApi.WIIUSE_STACK_UNKNOWN or WiiUseApi.WIIUSE_STACK_MS or + * WiiUseApi.WIIUSE_STACK_BLUESOLEIL. + */ +JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_windowsSetBluetoothStack +(JNIEnv *env, jobject obj, jint bluetoothStackType) { + if (bluetoothStackType == 0){ + wiiuse_set_bluetooth_stack(wiimotes, nbMaxWiimotes, WIIUSE_STACK_UNKNOWN); + }else if (bluetoothStackType == 1){ + wiiuse_set_bluetooth_stack(wiimotes, nbMaxWiimotes, WIIUSE_STACK_MS); + }else if (bluetoothStackType == 2){ + wiiuse_set_bluetooth_stack(wiimotes, nbMaxWiimotes, WIIUSE_STACK_BLUESOLEIL); + } +} + /** * Get status and values from the wiimotes and send it through callbacks. * @param wim the wiimote object to fill with the datas. @@ -416,7 +434,7 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_specialPoll WIIUSE_GET_IR_SENSITIVITY_CORRECTED(wiimotes[i], &a); mid = (*env)->GetMethodID(env, cls, "prepareIRevent", - "(IIIIIIIIISSSF)V"); + "(IIFIIIIIISSSF)V"); if (mid == 0) { return; } diff --git a/WiiUseJC/wiiusej_WiiUseApi.def b/WiiUseJC/wiiusej_WiiUseApi.def index 3b6de9c..e7aebd3 100644 --- a/WiiUseJC/wiiusej_WiiUseApi.def +++ b/WiiUseJC/wiiusej_WiiUseApi.def @@ -30,4 +30,5 @@ Java_wiiusej_WiiUseApi_setTimeout Java_wiiusej_WiiUseApi_setIrSensitivity Java_wiiusej_WiiUseApi_setNunchukOrientationThreshold Java_wiiusej_WiiUseApi_setNunchukAccelerationThreshold +Java_wiiusej_WiiUseApi_windowsSetBluetoothStack Java_wiiusej_WiiUseApi_specialPoll diff --git a/WiiUseJC/wiiusej_WiiUseApi.h b/WiiUseJC/wiiusej_WiiUseApi.h index bdc289a..3680631 100644 --- a/WiiUseJC/wiiusej_WiiUseApi.h +++ b/WiiUseJC/wiiusej_WiiUseApi.h @@ -255,6 +255,14 @@ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setNunchukOrientationThreshold JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setNunchukAccelerationThreshold (JNIEnv *, jobject, jint, jint); +/* + * Class: wiiusej_WiiUseApi + * Method: windowsSetBluetoothStack + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_windowsSetBluetoothStack + (JNIEnv *, jobject, jint); + /* * Class: wiiusej_WiiUseApi * Method: specialPoll