bool CryVR_WiimoteManagerPlugin::SetTimeout( int val ) { if ( init && found > 0 ) { timeout = val; wiiuse_set_timeout( wiimotes, found, timeout, timeout ); return true; } return false; }
void InitWiimotes() { printf("==> Initialisation du tableau des wiimotes\n"); WMTable = wiiuse_init(NB_WIIMOTES); printf("\n==> Recherche des wiimotes...\n"); int nFound = wiiuse_find(WMTable, NB_WIIMOTES, 5); printf("...%d wiimotes trouvees\n", nFound); printf("\n==> Connection des wiimotes...\n"); nConnectedWM = wiiuse_connect(WMTable, nFound); printf("...%d wiimotes connectees\n", nConnectedWM); wiiuse_set_timeout(WMTable, nConnectedWM, 0xFF, 0xFF); for(int n=0 ; n<nConnectedWM; n++) { wiiuse_set_ir(WMTable[n],1); wiiuse_rumble(WMTable[n], true); } //Signal lumineux for(int n=0 ; n<4 ; n++) { int nPow = 1; for(int i=0 ; i<n ; i++) nPow*=2; for(int i=0 ; i<nConnectedWM ; i++) { wiiuse_set_leds(WMTable[i], nPow*16); if(n==0)wiiuse_rumble(WMTable[i], false); } Sleep(100); } for(int n=0 ; n<nConnectedWM ; n++) { wiiuse_set_leds(WMTable[n], 0x90); } }
/** * Set the normal and expansion handshake timeouts. * * @param id * the id of the wiimote concerned. * @param normalTimeout * The timeout in milliseconds for a normal read. * @param expansionTimeout * The timeout in millisecondsd to wait for an expansion * handshake. */ JNIEXPORT void JNICALL Java_wiiusej_WiiUseApi_setTimeout (JNIEnv *env, jobject obj, jint id, jshort normalTimeout, jshort expansionTimeout) { wiiuse_set_timeout(wiimotes, nbMaxWiimotes, normalTimeout, expansionTimeout); }