Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 66283 Details for
Bug 150217
Feature request: add BaseAgent.sendData(int, byte[]) in Java API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Introduce JNI implementation of sendData(int, byte[]) and fix sendData(int, char[]) bug
sendData_ac.patch (text/plain), 2.89 KB, created by
Stanislav Polevic
on 2007-05-08 09:42:13 EDT
(
hide
)
Description:
Introduce JNI implementation of sendData(int, byte[]) and fix sendData(int, char[]) bug
Filename:
MIME Type:
Creator:
Stanislav Polevic
Created:
2007-05-08 09:42:13 EDT
Size:
2.89 KB
patch
obsolete
>Index: src-native-new/src/javaBaseAgent/BaseAgentJNI.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/javaBaseAgent/BaseAgentJNI.cpp,v >retrieving revision 1.8 >diff -u -r1.8 BaseAgentJNI.cpp >--- src-native-new/src/javaBaseAgent/BaseAgentJNI.cpp 6 Jun 2006 01:29:00 -0000 1.8 >+++ src-native-new/src/javaBaseAgent/BaseAgentJNI.cpp 8 May 2007 10:08:54 -0000 >@@ -173,14 +173,14 @@ > jsize len =0; > jchar* bytearr = NULL; > >- len = (jsize)(env->GetArrayLength(buffer)); >+ len = (jsize)env->GetArrayLength(buffer); > > if(len !=0) > { > bytearr = env->GetCharArrayElements(buffer, 0); > } > >- returnValue = baseAgentImpl->sendData(targetInstanceId, (char *)bytearr, len+1); >+ returnValue = baseAgentImpl->sendData(targetInstanceId, (char *)bytearr, (len * sizeof(jchar) / sizeof(char))); > > //Release > if(bytearr) >@@ -193,6 +193,27 @@ > > /* > * Class: org_eclipse_tptp_platform_execution_agent_impl_RemoteAgentImpl >+ * Method: sendData1 >+ * Signature: (I[BII)I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData1 >+ (JNIEnv *env, jobject thisObj, jint targetInstanceId, jbyteArray buffer, jint offset, jint length) >+{ >+ jsize bufLen = env->GetArrayLength (buffer); >+ if (bufLen <= 0) return 0; >+ >+ jbyte* bytearr = env->GetByteArrayElements(buffer, NULL) + offset; >+ jint returnValue = baseAgentImpl->sendData(targetInstanceId, (char *) bytearr, length); >+ >+ // Release >+ if (bytearr) >+ env->ReleaseByteArrayElements(buffer, bytearr, 0); >+ >+ return returnValue; >+} >+ >+/* >+ * Class: org_eclipse_tptp_platform_execution_agent_impl_RemoteAgentImpl > * Method: sendCommand0 > * Signature: (Ljava/lang/String;)I > */ >Index: src-native-new/src/javaBaseAgent/BaseAgentJNI.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/javaBaseAgent/BaseAgentJNI.h,v >retrieving revision 1.5 >diff -u -r1.5 BaseAgentJNI.h >--- src-native-new/src/javaBaseAgent/BaseAgentJNI.h 10 Feb 2006 18:32:12 -0000 1.5 >+++ src-native-new/src/javaBaseAgent/BaseAgentJNI.h 26 Apr 2007 12:36:00 -0000 >@@ -70,6 +70,13 @@ > JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData0 > (JNIEnv *, jobject, jint, jcharArray, jint); > >+ /* >+ * Class: org_eclipse_tptp_platform_execution_datacollection_BaseAgent >+ * Method: sendData1 >+ * Signature: (I[BII)I >+ */ >+JNIEXPORT jint JNICALL Java_org_eclipse_tptp_platform_execution_datacollection_BaseAgent_sendData1 >+ (JNIEnv *, jobject, jint, jbyteArray, jint, jint); > > /* > * Class: org_eclipse_tptp_platform_execution_datacollection_BaseAgent > * Method: sendCommand0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 150217
: 66283 |
66284