Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 150217 | Differences between
and this patch

Collapse All | Expand All

(-)src-native-new/src/javaBaseAgent/BaseAgentJNI.cpp 6 Jun 2006 01:29:00 -0000 1.8 (-2 / +23 lines)
Lines 173-186 Link Here
173
   jsize   len =0;
173
   jsize   len =0;
174
   jchar*  bytearr = NULL;
174
   jchar*  bytearr = NULL;
175
   len = (jsize)(env->GetArrayLength(buffer));
175
   len = (jsize)env->GetArrayLength(buffer);
176
   if(len !=0)
176
   if(len !=0)
177
   { 
177
   { 
178
       bytearr = env->GetCharArrayElements(buffer, 0);
178
       bytearr = env->GetCharArrayElements(buffer, 0);
179
   }
179
   }
180
   returnValue = baseAgentImpl->sendData(targetInstanceId, (char *)bytearr, len+1);
180
   returnValue = baseAgentImpl->sendData(targetInstanceId, (char *)bytearr, (len * sizeof(jchar) / sizeof(char)));
181
181
182
   //Release
182
   //Release
183
   if(bytearr)
183
   if(bytearr)
Lines 193-198 Link Here
193
/*
193
/*
194
 * Class:     org_eclipse_tptp_platform_execution_agent_impl_RemoteAgentImpl
194
 * Class:     org_eclipse_tptp_platform_execution_agent_impl_RemoteAgentImpl
195
 * Method:    sendData1
196
 * Signature: (I[BII)I
197
 */
198
JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData1
199
   (JNIEnv *env, jobject thisObj, jint targetInstanceId, jbyteArray buffer, jint offset, jint length)
200
{
201
   jsize bufLen = env->GetArrayLength (buffer);
202
   if (bufLen <= 0) return 0;
203
204
   jbyte* bytearr = env->GetByteArrayElements(buffer, NULL) + offset;
205
   jint returnValue = baseAgentImpl->sendData(targetInstanceId, (char *) bytearr, length);
206
207
   // Release
208
   if (bytearr)
209
       env->ReleaseByteArrayElements(buffer, bytearr, 0);
210
211
   return returnValue;
212
}
213
214
/*
215
 * Class:     org_eclipse_tptp_platform_execution_agent_impl_RemoteAgentImpl
195
 * Method:    sendCommand0
216
 * Method:    sendCommand0
196
 * Signature: (Ljava/lang/String;)I
217
 * Signature: (Ljava/lang/String;)I
197
 */
218
 */
(-)src-native-new/src/javaBaseAgent/BaseAgentJNI.h 10 Feb 2006 18:32:12 -0000 1.5 (+7 lines)
Lines 70-75 Link Here
70
JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData0
70
JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData0
71
  (JNIEnv *, jobject, jint, jcharArray, jint);
71
  (JNIEnv *, jobject, jint, jcharArray, jint);
72
72
73
 /*
74
  * Class:     org_eclipse_tptp_platform_execution_datacollection_BaseAgent
75
  * Method:    sendData1
76
  * Signature: (I[BII)I
77
  */
78
JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData1
79
    (JNIEnv *, jobject, jint, jbyteArray, jint, jint);
73
/*
80
/*
74
 * Class:     org_eclipse_tptp_platform_execution_datacollection_BaseAgent
81
 * Class:     org_eclipse_tptp_platform_execution_datacollection_BaseAgent
75
 * Method:    sendCommand0
82
 * Method:    sendCommand0

Return to bug 150217