* (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
*
*/
-#include <string.h>
-#include <stdlib.h>
-// library header file's path
-#include "orte.h"
-// getNtpTime function
-#include "jorte/jorte_protos_api.h"
-// enable TEST_STAGE run level
-#include "jorte/4all.h"
-// pregenerated header
-#include "jorte/org_ocera_orte_Publication.h"
+#include "jorte/jorte.h"
JNIEXPORT jboolean JNICALL
Java_org_ocera_orte_Publication_jORTEPublicationPropertiesSet
-(JNIEnv *env, jobject obj, jint j_appDomain_handle, jobject obj_pp)
+(JNIEnv *env, jobject obj, jlong j_appDomain_handle, jobject obj_pp)
{
// jni types
jclass cls_pp = NULL;
}
str = (*env)->GetStringUTFChars(env,obj_str,0);
// set structure's field
- strncpy((char *) publ_prop->topic, str, strlen(str) + 1);
+ strncpy((char *)publ_prop->topic, (const char*)str, strlen(str) + 1);
#ifdef TEST_STAGE
printf(":c: topic = %s, publ_prop->topic = %s \n",
str, publ_prop->topic);
}
str = (*env)->GetStringUTFChars(env,obj_str,0);
// set structure's field
- strncpy((char *) publ_prop->typeName, str, strlen(str) + 1);
+ strncpy((char *)publ_prop->typeName, (const char*)str, strlen(str) + 1);
#ifdef TEST_STAGE
printf(":c: typeName = %s, publ_prop->typeName = %s \n",
str, publ_prop->typeName);
}
publ_prop->typeChecksum = (TypeChecksum) (*env)->GetIntField(env, obj_pp, fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->typeChecksum = %d\n",
+ printf(":c: check: publ_prop->typeChecksum = %"PRId32"\n",
publ_prop->typeChecksum);
#endif
/////////////////////////////////////////////////
if (jbool == 0) publ_prop->expectsAck = ORTE_FALSE;
else publ_prop->expectsAck = ORTE_TRUE;
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->expectsAck = %d\n", publ_prop->expectsAck);
+ printf(":c: check: publ_prop->expectsAck = %"PRId8"\n", publ_prop->expectsAck);
#endif
/////////////////////////////////////////////////
// set persistence
}
publ_prop->persistence = getNtpTime(env, obj_ntpT);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->persistence: sec = %d, fract = %d \n",
+ printf(":c: check: publ_prop->persistence: sec = %"PRId32", fract = %"PRIu32" \n",
publ_prop->persistence.seconds, publ_prop->persistence.fraction);
#endif
/////////////////////////////////////////////////
}
publ_prop->reliabilityOffered = (uint32_t) (*env)->GetLongField(env, obj_pp, fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->reliabilityOffered = %d \n",
+ printf(":c: check: publ_prop->reliabilityOffered = %"PRIu32" \n",
publ_prop->reliabilityOffered);
#endif
/////////////////////////////////////////////////
}
publ_prop->sendQueueSize = (uint32_t) (*env)->GetLongField(env,obj_pp,fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->sendQueueSize = %d \n",
+ printf(":c: check: publ_prop->sendQueueSize = %"PRIu32" \n",
publ_prop->sendQueueSize);
#endif
/////////////////////////////////////////////////
}
publ_prop->strength = (int32_t) (*env)->GetIntField(env,obj_pp,fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->strength = %d \n",
+ printf(":c: check: publ_prop->strength = %"PRId32" \n",
publ_prop->strength);
#endif
/////////////////////////////////////////////////
}
publ_prop->criticalQueueLevel = (uint32_t) (*env)->GetLongField(env, obj_pp, fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->criticalQueueLevel = %d \n",
+ printf(":c: check: publ_prop->criticalQueueLevel = %"PRIu32" \n",
publ_prop->criticalQueueLevel);
#endif
/////////////////////////////////////////////////
obj_ntpT = (*env)->GetObjectField(env, obj_pp, fid);
publ_prop->HBNornalRate = getNtpTime(env, obj_ntpT);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->HBNornalRate: sec = %d, fract = %d \n",
+ printf(":c: check: publ_prop->HBNornalRate: sec = %"PRId32", fract = %"PRIu32" \n",
publ_prop->HBNornalRate.seconds, publ_prop->HBNornalRate.fraction);
#endif
/////////////////////////////////////////////////
}
publ_prop->HBCQLRate = getNtpTime(env, obj_ntpT);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->HBCQLRate: sec = %d, fract = %d \n",
+ printf(":c: check: publ_prop->HBCQLRate: sec = %"PRId32", fract = %"PRIu32" \n",
publ_prop->HBCQLRate.seconds, publ_prop->HBCQLRate.fraction);
#endif
/////////////////////////////////////////////////
}
publ_prop->HBMaxRetries = (unsigned int) (*env)->GetLongField(env, obj_pp, fid);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->HBMaxRetries = %d \n",
+ printf(":c: check: publ_prop->HBMaxRetries = %u \n",
publ_prop->HBMaxRetries);
#endif
/////////////////////////////////////////////////
}
publ_prop->maxBlockTime = getNtpTime(env, obj_ntpT);
#ifdef TEST_STAGE
- printf(":c: check: publ_prop->maxBlockTime: sec = %d, fract = %d \n",
+ printf(":c: check: publ_prop->maxBlockTime: sec = %"PRId32", fract = %"PRIu32" \n",
publ_prop->maxBlockTime.seconds, publ_prop->maxBlockTime.fraction);
#endif
/////////////////////////////////////////////////