/** * Return the InWindow output of the analog trigger. * True if the analog input is between the upper and lower limits. * @return True if the analog input is between the upper and lower limits. */ bool AnalogTrigger::GetInWindow() { if (StatusIsFatal()) return false; int32_t status = 0; bool result = getAnalogTriggerInWindow(m_trigger, &status); wpi_setErrorWithContext(status, getHALErrorMessage(status)); return result; }
/* * Class: edu_wpi_first_wpilibj_hal_AnalogJNI * Method: getAnalogTriggerInWindow * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B */ JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerInWindow (JNIEnv * env, jclass, jobject id, jobject status) { void ** javaId = (void**)env->GetDirectBufferAddress(id); ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Ptr = " << *javaId; jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); ANALOGJNI_LOG(logDEBUG) << "Status Ptr = " << statusPtr; return getAnalogTriggerInWindow( *javaId, statusPtr ); }