Commit 65878a47 authored by Markus Jung's avatar Markus Jung Committed by Madan Lanka

[IOT-1020], [IOT-1024], [IOT-1029], [IOT-1030] fixes

- param check for getConfiguredResourceParams API
- updated example configuration for Android sample of resource container
- removed getLibraryPath API from Android wrapper

Change-Id: Ib825240a2ebec7cfa0a61e1ae63e156408904bd6
Signed-off-by: default avatarMarkus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6211Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent d2d8a8af
......@@ -86,16 +86,6 @@ public class RcsBundleInfo {
return mActivatorName;
}
/**
* API for getting the library path for the bundle
*
* @return string - Library path in string form
*
*/
public String getLibraryPath() {
return mLibraryPath;
}
/**
* API for getting the version of the bundle
*
......
......@@ -269,7 +269,7 @@ public class RcsResourceContainer implements RcsResourceContainerBundleAPI {
List<RcsBundleInfo> bundles = listBundles();
for(RcsBundleInfo bundleInfo : bundles){
if(bundleInfo.getID().equals(bundleId) && bundleInfo.getLibraryPath().endsWith(".apk")){
if(bundleInfo.getID().equals(bundleId) && bundleInfo.getPath().endsWith(".apk")){
Log.d(TAG, "Have to start android bundle");
Log.d(TAG, "bundle-id: " + bundleInfo.getID() + ", " + bundleInfo.getPath());
if(bundleInfo.getPath().endsWith(".apk")){
......
......@@ -460,19 +460,23 @@ Java_org_iotivity_service_resourcecontainer_RcsResourceContainer_nativeGetConfig
{
(void)obj;
jobjectArray ret;
const char *str_bundleId = env->GetStringUTFChars(bundleId, 0);
ResourceContainerImpl *container = ResourceContainerImpl::getImplInstance();
vector< resourceInfo > resourceConfig;
container->getResourceConfiguration(str_bundleId, &resourceConfig);
resourceInfo conf = resourceConfig[resourceId];
ret = (jobjectArray) env->NewObjectArray(4, env->FindClass("java/lang/String"),
env->NewStringUTF(""));
env->NewStringUTF(""));
if(bundleId != NULL){
const char *str_bundleId = env->GetStringUTFChars(bundleId, 0);
env->SetObjectArrayElement(ret, 0, env->NewStringUTF(conf.name.c_str()));
env->SetObjectArrayElement(ret, 1, env->NewStringUTF(conf.uri.c_str()));
env->SetObjectArrayElement(ret, 2, env->NewStringUTF(conf.resourceType.c_str()));
env->SetObjectArrayElement(ret, 3, env->NewStringUTF(conf.address.c_str()));
ResourceContainerImpl *container = ResourceContainerImpl::getImplInstance();
vector< resourceInfo > resourceConfig;
container->getResourceConfiguration(str_bundleId, &resourceConfig);
if(resourceConfig.size() > resourceId && resourceId >=0){
resourceInfo conf = resourceConfig[resourceId];
env->SetObjectArrayElement(ret, 0, env->NewStringUTF(conf.name.c_str()));
env->SetObjectArrayElement(ret, 1, env->NewStringUTF(conf.uri.c_str()));
env->SetObjectArrayElement(ret, 2, env->NewStringUTF(conf.resourceType.c_str()));
env->SetObjectArrayElement(ret, 3, env->NewStringUTF(conf.address.c_str()));
}
}
return ret;
}
<container>
<!--
<bundle>
<id>oic.bundle.discomfortIndexSensor</id>
<path>data/data/org.iotivity.service.sample.resourcecontainer/files/libDISensorBundle.so</path>
<activator>disensor</activator>
<version>1.0.0</version>
<resources>
<resourceInfo>
<name>DiscomfortIndexSensor1</name>
<resourceType>oic.r.sensor</resourceType>
<outputs>
<output>
<name>discomfortIndex</name>
<type>int</type>
</output>
<output>
<name>humidity</name>
<type>double</type>
</output>
<output>
<name>temperature</name>
<type>double</type>
</output>
</outputs>
<inputs>
<input>
<name>humidity</name>
<type>double</type>
<resourceType>oic.r.humidity</resourceType>
</input>
<input>
<name>temperature</name>
<type>double</type>
<resourceType>oic.r.temperature</resourceType>
</input>
</inputs>
</resourceInfo>
</resources>
</bundle>
<!--<bundle>
<id>oic.android.sample</id>
<path>org.iotivity.service.sample.androidbundle.apk</path>
<path>data/data/org.iotivity.service.sample.resourcecontainer/files/android_sample_bundle.jar</path>
<activator>org.iotivity.service.sample.androidbundle.SampleActivator</activator>
<version>1.0.0</version>
<resources>
......@@ -49,9 +12,9 @@
<resourceUri>/android/light/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>LightIntensity1</name>
<resourceType>oic.r.lightintensity</resourceType>
<resourceUri>/android/lightintensity/1</resourceUri>
<name>LightIntensity1</name>
<resourceType>oic.r.lightintensity</resourceType>
<resourceUri>/android/lightintensity/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>Humidity1</name>
......@@ -72,6 +35,7 @@
<name>DiscomfortIndexSensor1</name>
<resourceType>oic.r.discomfortindex</resourceType>
<resourceUri>/android/discomfortindex/1</resourceUri>
<resourceClass>org.iotivity.service.sample.androidbundle.resources.DiscomfortIndexResource</resourceClass>
<outputs>
<output>
<name>discomfortIndex</name>
......@@ -101,41 +65,15 @@
</resourceInfo>
</resources>
</bundle>
<bundle>
<id>oic.android.sample</id>
<path>data/data/org.iotivity.service.sample.resourcecontainer/files/android_sample_bundle.jar</path>
<activator>org.iotivity.service.sample.androidbundle.SampleActivator</activator>
<bundle>
<id>oic.bundle.discomfortIndexSensor</id>
<path>data/data/org.iotivity.service.sample.resourcecontainer/files/libDISensorBundle.so</path>
<activator>disensor</activator>
<version>1.0.0</version>
<resources>
<resourceInfo>
<name>LightResource1</name>
<resourceType>oic.r.light</resourceType>
<resourceUri>/android/light/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>LightIntensity1</name>
<resourceType>oic.r.lightintensity</resourceType>
<resourceUri>/android/lightintensity/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>Humidity1</name>
<resourceType>oic.r.humidity</resourceType>
<resourceUri>/android/humidity/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>Tepmerature1</name>
<resourceType>oic.r.temperature</resourceType>
<resourceUri>/android/temperature/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>Gyroscope1</name>
<resourceType>oic.r.gyroscope</resourceType>
<resourceUri>/android/gyroscope/1</resourceUri>
</resourceInfo>
<resourceInfo>
<name>DiscomfortIndexSensor1</name>
<resourceType>oic.r.discomfortindex</resourceType>
<resourceUri>/android/discomfortindex/1</resourceUri>
<resourceType>oic.r.sensor</resourceType>
<outputs>
<output>
<name>discomfortIndex</name>
......@@ -164,5 +102,6 @@
</inputs>
</resourceInfo>
</resources>
</bundle>-->
</bundle>
-->
</container>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment