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_TextLEDPhidget.c | |
download | libphidget21-0b624384cd52be20e61284551d832b499d7b7707.tar.gz |
Imported Upstream version 2.1.8.20120216upstream/2.1.8.20120216
Diffstat (limited to 'Java/com_phidgets_TextLEDPhidget.c')
-rw-r--r-- | Java/com_phidgets_TextLEDPhidget.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Java/com_phidgets_TextLEDPhidget.c b/Java/com_phidgets_TextLEDPhidget.c new file mode 100644 index 0000000..f6f139c --- /dev/null +++ b/Java/com_phidgets_TextLEDPhidget.c @@ -0,0 +1,29 @@ +#include "../stdafx.h" +#include "phidget_jni.h" +#include "com_phidgets_TextLEDPhidget.h" +#include "../cphidgettextled.h" + +JNI_LOAD(led, TextLED) +} + +JNI_CREATE(TextLED) +JNI_GETFUNC(TextLED, Brightness, Brightness, jint) +JNI_SETFUNC(TextLED, Brightness, Brightness, jint) +JNI_GETFUNC(TextLED, RowCount, RowCount, jint) +JNI_GETFUNC(TextLED, ColumnCount, ColumnCount, jint) + +JNIEXPORT void JNICALL +Java_com_phidgets_TextLEDPhidget_setDisplayString(JNIEnv *env, jobject obj, jint index, jstring v) +{ + CPhidgetTextLEDHandle h = (CPhidgetTextLEDHandle)(uintptr_t) + (*env)->GetLongField(env, obj, handle_fid); + int error; + jboolean iscopy; + const char *textString = (*env)->GetStringUTFChars( + env, v, &iscopy); + + if ((error = CPhidgetTextLED_setDisplayString(h, index, (char *)textString))) + PH_THROW(error); + + (*env)->ReleaseStringUTFChars(env, v, textString); +} |