]> rtime.felk.cvut.cz Git - orte.git/blobdiff - orte/libjorte/JNtpTimeToStringUs.c
JORTE: update license headers and clean-up includes
[orte.git] / orte / libjorte / JNtpTimeToStringUs.c
index b8029bab0376c0983e5e24fd0a4747bf1439a69b..f61b3938da8a74c155606a210c723cfae2202624 100644 (file)
@@ -1,4 +1,5 @@
 /* JNtpTimeToStringUs.c */
+
 /**
   * This code provides conversion between JAVA a C environments.
   * The C functions are calling here and results are send to JAVA
@@ -6,6 +7,7 @@
   * (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
@@ -61,7 +58,7 @@ Java_org_ocera_orte_types_JORTENtpTime_NtpTimeToStringUs
   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);