Example #1
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
 * Method:    getDIODirection
 * Signature: (J)Z
 */
JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection
  (JNIEnv *env, jclass, jlong id)
{
	DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIODirection (RR upd)";
	//DIOJNI_LOG(logDEBUG) << "Port Ptr = " << (void*)id;
	int32_t status = 0;
	jboolean returnValue = getDIODirection((void*)id, &status);
	//DIOJNI_LOG(logDEBUG) << "Status = " << status;
	DIOJNI_LOG(logDEBUG) << "getDIODirectionResult = " << (jint)returnValue;
	CheckStatus(env, status);
	return returnValue;
}
Example #2
0
/*
 * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
 * Method:    getDIODirection
 * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B
 */
JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection
(JNIEnv *env, jclass, jobject id, jobject status)
{
    DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIODirection (RR upd)";
    void ** javaId = (void**)env->GetDirectBufferAddress(id);
    //DIOJNI_LOG(logDEBUG) << "Port Ptr = " << *javaId;
    jint * statusPtr = (jint*)env->GetDirectBufferAddress(status);
    //DIOJNI_LOG(logDEBUG) << "Status Ptr = " << statusPtr;
    jbyte returnValue = getDIODirection(*javaId, statusPtr);
    //DIOJNI_LOG(logDEBUG) << "Status = " << *statusPtr;
    DIOJNI_LOG(logDEBUG) << "getDIODirectionResult = " << (jbyte)returnValue;
    return returnValue;
}