/* * Class: edu_wpi_first_wpilibj_hal_PowerJNI * Method: getUserActive5V * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V (JNIEnv * env, jclass) { int32_t status = 0; bool val = getUserActive5V(&status); CheckStatus(env, status); return val; }
/** * Get the enabled state of the 5V rail. The rail may be disabled due to a * controller * brownout, a short circuit on the rail, or controller over-voltage * @return The controller 5V rail enabled value. True for enabled. */ bool ControllerPower::GetEnabled5V() { int32_t status = 0; bool retVal = getUserActive5V(&status); wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status)); return retVal; }
/* * Class: edu_wpi_first_wpilibj_hal_PowerJNI * Method: getUserActive5V * Signature: (Ljava/nio/IntBuffer;)Z */ JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V (JNIEnv * env, jclass, jobject status) { jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); return getUserActive5V(statusPtr); }