]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/native/FMUSimulator/src/fmu_control.cpp
Pending status can be returns from FMU to Native C to Java
[simantics/fmil.git] / org.simantics.fmil.core / native / FMUSimulator / src / fmu_control.cpp
index ae86d2b047c387e8698a3f6037a1cf4db42fd66c..28e75f74c2b3a4c7dde14119cea95a1be1885902 100644 (file)
@@ -693,14 +693,14 @@ JNIEXPORT jint JNICALL Java_org_simantics_fmil_core_FMIL_simulateStep_1
          } else if (fmi.version == 2) {
                  returnValue = FMI2_CS_STEP(fmi.fmu, fmi.currentTime, fmi.timeStep, &error);
          }
-         if(returnValue != 0) {
+         if(returnValue == 1) {
                  string message = "Could not simulate step: ";
                  return throwException(env,  message += error);
          }
 
          fmi.currentTime += fmi.timeStep;
 
-         return 0;
+         return returnValue; //Pass return value up. 0 is OK, 1 is error, 2 is pending
 
          /*
        const char *fmuId = env->GetStringUTFChars(id, 0);