aboutsummaryrefslogtreecommitdiffstats
path: root/Java/com_phidgets_LEDPhidget.c
blob: 20097b9d2318babd9e1454c8faf4c122d1814895 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "../stdafx.h"
#include "phidget_jni.h"
#include "com_phidgets_LEDPhidget.h"
#include "../cphidgetled.h"

JNI_LOAD(accel, LED)
}

JNI_CREATE(LED)
JNI_INDEXED_GETFUNC(LED, DiscreteLED, DiscreteLED, jint)
JNI_INDEXED_SETFUNC(LED, DiscreteLED, DiscreteLED, jint)
JNI_GETFUNC(LED, LEDCount, LEDCount, jint)

JNIEXPORT jint JNICALL
Java_com_phidgets_LEDPhidget_getCurrentLimit(JNIEnv *env, jobject obj)
{
	CPhidgetLEDHandle h = (CPhidgetLEDHandle)(uintptr_t)
	    (*env)->GetLongField(env, obj, handle_fid);
	int error;
	CPhidgetLED_CurrentLimit v;
	if ((error = CPhidgetLED_getCurrentLimit(h, &v)))
		PH_THROW(error);
	return (jint)v;
}
JNI_SETFUNC(LED, CurrentLimit, CurrentLimit, jint)

JNIEXPORT jint JNICALL
Java_com_phidgets_LEDPhidget_getVoltage(JNIEnv *env, jobject obj)
{
	CPhidgetLEDHandle h = (CPhidgetLEDHandle)(uintptr_t)
	    (*env)->GetLongField(env, obj, handle_fid);
	int error;
	CPhidgetLED_Voltage v;
	if ((error = CPhidgetLED_getVoltage(h, &v)))
		PH_THROW(error);
	return (jint)v;
}
JNI_SETFUNC(LED, Voltage, Voltage, jint)
>/+5 2012-02-20Add PHP to make installJonathan McCrohan1-0/+3 2012-02-20Update MakefileJonathan McCrohan1-0/+17 2012-02-20Move interval.txt to src/Jonathan McCrohan2-1/+1 2012-02-19Remove debug/testing files.Jonathan McCrohan50-4742/+0 2012-02-15Archive files after upload.Jonathan McCrohan1-0/+2 2012-02-12Fix typo in README.Jonathan McCrohan1-1/+1 2012-02-12Add ftp upload function + add documentation.Jonathan McCrohan5-3/+151 2012-01-10Handle 32bit signed overflow.Jonathan McCrohan1-1/+6 2012-01-10Update README.Jonathan McCrohan1-1/+3