/* JNtpTimeToStringUs.c */
+
/**
* This code provides conversion between JAVA a C environments.
* The C functions are calling here and results are send to JAVA
* (by command 'javah -jni class_with_native_function')
*
* @author Lukas Pokorny (lukas_pokorny@centrum.cz)
+ * @author Martin Vajnar (martin.vajnar@gmail.com)
* @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
* @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
* @author dedication to Kj
*/
-// origin orte headers
-#include "orte.h"
-// pregenerated header
-#include "jorte/org_ocera_orte_types_NtpTime.h"
-
-
+#include "jorte/jorte.h"
/* native function - prototype declared in pregenerated header */
JNIEXPORT jstring JNICALL
-Java_org_ocera_orte_types_JORTENtpTime_NtpTimeToStringUs
+Java_org_ocera_orte_types_NtpTime_NtpTimeToStringUs
(JNIEnv *env, jclass class, jobject j_ntpTime)
{
char buff[65]; // 32 + 32 + 1 end char
if(fieldID == NULL)
return((*env)->NewStringUTF(env, "error when reading Java NtpTime"));
// get object's value
- time.fraction = (uint32_t) (*env)->GetIntField(env,j_ntpTime,fieldID);
+ time.fraction = (uint32_t) (*env)->GetLongField(env,j_ntpTime,fieldID);
// calling an orte's function
NtpTimeToStringUs(time,buff);