Esempio n. 1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
 * Method:    getPDPTemperature
 * Signature: (Ljava/nio/IntBuffer;)D
 */
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature
(JNIEnv *env, jclass, jobject status, jint module)
{
    jint *status_ptr = (jint *)env->GetDirectBufferAddress(status);

    return getPDPTemperature(status_ptr, module);
}
Esempio n. 2
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
 * Method:    getPDPTemperature
 * Signature: (I)D
 */
JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature
  (JNIEnv *env, jclass, jint module)
{
	int32_t status = 0;
	double temperature = getPDPTemperature(module, &status);
  CheckStatus(env, status, false);
  return temperature;
}
/**
 * Query the temperature of the PDP
 * @return The temperature of the PDP in degrees Celsius
 */
double
PowerDistributionPanel::GetTemperature() {
	int32_t status = 0;
	
	double temperature = getPDPTemperature(&status);
	
	if(status) {
		wpi_setWPIErrorWithContext(Timeout, "");
	}
	
	return temperature;
}