5 #include "jorte/4all.h"
6 #include "jorte/jorte_protos_api.h"
10 createAppInfo(JNIEnv *env, const ORTEAppInfo *ainfo)
23 cls = findClass(env, "org.ocera.orte.types.AppInfo");
26 printf(":!c: cls = NULL \n");
30 // call object constructor
31 mid = (*env)->GetMethodID(env, cls, "<init>", "()V");
34 printf(":!c: constructor failed! \n");
39 obj = (*env)->NewObject(env, cls, mid);
42 printf(":!c: obj = NULL \n");
47 fid = (*env)->GetFieldID(env, cls, "hostId", "J");
50 printf(":!c: fid = NULL \n");
55 printf(":c: ainfo.hostId = %#" PRIx32 " \n", ainfo->hostId);
57 (*env)->SetLongField(env,
60 (jlong)ainfo->hostId);
63 fid = (*env)->GetFieldID(env, cls, "appId", "J");
66 printf(":!c: fid = NULL \n");
71 printf(":c: ainfo.appId = %#" PRIx32 " \n", ainfo->appId);
73 (*env)->SetLongField(env,
77 // field ID - unicastIPAddressTemp
78 fid = (*env)->GetFieldID(env, cls, "unicastIPAddressTemp", "J");
81 printf(":!c: fid uniIPAddrTemp = NULL \n");
86 printf(":c: ainfo.unicastIPAddressList = %#" PRIxPTR "\n", (intptr_t)ainfo->unicastIPAddressList);
88 (*env)->SetLongField(env,
91 (jlong) *ainfo->unicastIPAddressList);
92 // field ID - unicastIPcount
93 fid = (*env)->GetFieldID(env, cls, "unicastIPcount", "B");
96 printf(":!c: fid = NULL \n");
101 printf(":c: ainfo.unicastIPcount = %hhu \n",
102 ainfo->unicastIPAddressCount);
104 (*env)->SetByteField(env,
107 (jbyte)ainfo->unicastIPAddressCount);
108 // field ID - multicastIPAddressTemp
109 fid = (*env)->GetFieldID(env, cls, "mettaTrafficMulticastIPAddressTemp", "J");
112 printf(":!c: fid multiIPAddrTemp = NULL \n");
117 printf(":c: ainfo.multicastIPAddressList = %#" PRIxPTR "\n",
118 (intptr_t)ainfo->metatrafficMulticastIPAddressList);
120 (*env)->SetLongField(env,
123 (jlong) *ainfo->metatrafficMulticastIPAddressList);
124 // field ID - multicastIPcount
125 fid = (*env)->GetFieldID(env, cls, "multicastIPcount", "B");
128 printf(":!c: fid = NULL \n");
133 printf(":c: ainfo.metatrafficMulticastIPAddressCount = %hhu \n",
134 ainfo->metatrafficMulticastIPAddressCount);
136 (*env)->SetByteField(env,
139 (jbyte)ainfo->metatrafficMulticastIPAddressCount);
141 // field ID - mettatraficUnicastPort
142 fid = (*env)->GetFieldID(env, cls, "metatrafficUniPort", "J");
145 printf(":!c: fid = NULL \n");
150 printf(":c: ainfo.metatrafficUnicastPort = %" PRIu32 " \n",
151 ainfo->metatrafficUnicastPort);
153 (*env)->SetLongField(env,
156 (jlong)ainfo->metatrafficUnicastPort);
158 // field ID - userdataUnicastPort
159 fid = (*env)->GetFieldID(env, cls, "userdataUniPort", "J");
162 printf(":!c: fid = NULL \n");
167 printf(":c: ainfo.userdataUnicastPort = %" PRIu32 " \n",
168 ainfo->userdataUnicastPort);
170 (*env)->SetLongField(env,
173 (jlong)ainfo->userdataUnicastPort);
175 // find cls - VendorID
176 cls_tmp = findClass(env, "org.ocera.orte.types.VendorId");
179 printf(":!c: cls_tmp = NULL \n");
183 // call object constructor
184 mid = (*env)->GetMethodID(env,
190 printf(":!c: constructor failed! \n");
195 obj_tmp = (*env)->NewObject(env,
198 ainfo->vendorId.major,
199 ainfo->vendorId.minor);
202 printf(":!c: obj = NULL \n");
206 // set AppInfo's field
207 fid = (*env)->GetFieldID(env,
210 "Lorg/ocera/orte/types/VendorId;");
213 printf(":!c: fid = NULL \n");
218 printf(":c: ainfo.vendorId: major = %" PRId8 ", minor = %" PRId8 " \n",
219 ainfo->vendorId.major, ainfo->vendorId.minor);
221 (*env)->SetObjectField(env,
226 // find cls - VendorID
227 cls_tmp = findClass(env, "org.ocera.orte.types.ProtocolVersion");
230 printf(":!c: cls_tmp = NULL \n");
234 // call object constructor
235 mid = (*env)->GetMethodID(env,
241 printf(":!c: constructor failed! \n");
246 obj_tmp = (*env)->NewObject(env,
249 ainfo->protocolVersion.major,
250 ainfo->protocolVersion.minor);
253 printf(":!c: obj = NULL \n");
257 // set AppInfo's field
258 fid = (*env)->GetFieldID(env,
261 "Lorg/ocera/orte/types/ProtocolVersion;");
264 printf(":!c: fid = NULL \n");
269 printf(":c: ainfo.protocolVersion: major = %" PRId8 ", minor = %" PRId8 " \n",
270 ainfo->protocolVersion.major, ainfo->protocolVersion.minor);
272 (*env)->SetObjectField(env,