Exemple #1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserCurrent6V
 * Signature: ()F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V
  (JNIEnv * env, jclass)
{
	int32_t status = 0;
	float val = getUserCurrent6V(&status);
  CheckStatus(env, status);
  return val;
}
/**
 * Get the current output of the 6V rail
 * @return The controller 6V rail output current value in Amps
 */
double ControllerPower::GetCurrent6V() {
  int32_t status = 0;
  double retVal = getUserCurrent6V(&status);
  wpi_setGlobalErrorWithContext(status, getHALErrorMessage(status));
  return retVal;
}
Exemple #3
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
 * Method:    getUserCurrent6V
 * Signature: (Ljava/nio/IntBuffer;)F
 */
JNIEXPORT jfloat JNICALL Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V
  (JNIEnv * env, jclass, jobject status)
{
	jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
	return getUserCurrent6V(statusPtr);
}