diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-04-14 12:56:48 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2012-04-14 12:56:48 +0100 |
commit | 0b624384cd52be20e61284551d832b499d7b7707 (patch) | |
tree | 6f95a4bbef47abc9720b96c0722e8f632aef228a /Java/com_phidgets_BridgePhidget.c | |
download | libphidget21-0b624384cd52be20e61284551d832b499d7b7707.tar.gz |
Imported Upstream version 2.1.8.20120216upstream/2.1.8.20120216
Diffstat (limited to '')
-rw-r--r-- | Java/com_phidgets_BridgePhidget.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Java/com_phidgets_BridgePhidget.c b/Java/com_phidgets_BridgePhidget.c new file mode 100644 index 0000000..6f42cf7 --- /dev/null +++ b/Java/com_phidgets_BridgePhidget.c @@ -0,0 +1,40 @@ +#include "../stdafx.h"
+#include "phidget_jni.h"
+#include "com_phidgets_BridgePhidget.h"
+#include "../cphidgetbridge.h"
+
+EVENT_VARS(bridgeData, BridgeData)
+
+JNI_LOAD(bridge, Bridge)
+ EVENT_VAR_SETUP(bridge, bridgeData, BridgeData, ID, V)
+}
+
+EVENT_HANDLER_INDEXED(Bridge, bridgeData, BridgeData,
+ CPhidgetBridge_set_OnBridgeData_Handler, double)
+
+JNI_CREATE(Bridge)
+
+JNI_GETFUNC(Bridge, InputCount, InputCount, jint)
+JNI_INDEXED_GETFUNC(Bridge, BridgeValue, BridgeValue, jdouble)
+JNI_INDEXED_GETFUNC(Bridge, BridgeMin, BridgeMin, jdouble)
+JNI_INDEXED_GETFUNC(Bridge, BridgeMax, BridgeMax, jdouble)
+JNI_INDEXED_GETFUNCBOOL(Bridge, Enabled, Enabled)
+JNI_INDEXED_SETFUNC(Bridge, Enabled, Enabled, jboolean)
+
+JNIEXPORT jint JNICALL
+Java_com_phidgets_BridgePhidget_getGain(JNIEnv *env, jobject obj, jint index)
+{
+ CPhidgetBridgeHandle h = (CPhidgetBridgeHandle)(uintptr_t)
+ (*env)->GetLongField(env, obj, handle_fid);
+ int error;
+ CPhidgetBridge_Gain v;
+ if ((error = CPhidgetBridge_getGain(h, index, &v)))
+ PH_THROW(error);
+ return (jint)v;
+}
+
+JNI_INDEXED_SETFUNC(Bridge, Gain, Gain, jint)
+JNI_GETFUNC(Bridge, DataRate, DataRate, jint)
+JNI_SETFUNC(Bridge, DataRate, DataRate, jint)
+JNI_GETFUNC(Bridge, DataRateMin, DataRateMin, jint)
+JNI_GETFUNC(Bridge, DataRateMax, DataRateMax, jint)
\ No newline at end of file |