Modify PPM Sample Application & Plugins for updated base code
authorYounghyunJoo <yh_.joo@samsung.com>
Fri, 31 Jul 2015 11:12:46 +0000 (20:12 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 31 Jul 2015 15:48:12 +0000 (15:48 +0000)
- Change CA connectivity type(CA_DEAFULT)
- Fix some errors on plugins

Change-Id: Idcb2d2dfb77f1c9e98686161e6989d6b96367ac4
Signed-off-by: YounghyunJoo <yh_.joo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2022
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/protocol-plugin/plugin-manager/src/Android/src/org/iotivity/service/ppm/MainActivity.java
service/protocol-plugin/plugins/Android/plugin.gear.noti/src/oic/plugin/gear/noti/Activator.java
service/protocol-plugin/plugins/Android/plugin.hue/src/oic/plugin/hue/Activator.java
service/protocol-plugin/plugins/Android/plugin.wemo/src/oic/plugin/wemo/Activator.java

index e8324e1..d418cf2 100644 (file)
@@ -140,7 +140,7 @@ public class MainActivity extends Activity implements
         try {
             FoundResource foundResource = new FoundResource();
             OcPlatform.findResource("", OcPlatform.WELL_KNOWN_QUERY,
-                    OcConnectivityType.CT_ADAPTER_IP, foundResource);
+                    OcConnectivityType.CT_DEFAULT, foundResource);
         } catch (Exception e) {
             Log.e(LOG_TAG, "Exception : " + e);
         }
@@ -208,7 +208,7 @@ public class MainActivity extends Activity implements
                             OcPlatform
                                     .findResource(
                                             "", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "device.smartplug",
-                                            OcConnectivityType.CT_ADAPTER_IP, foundResource);
+                                            OcConnectivityType.CT_DEFAULT, foundResource);
                         } catch (OcException e) {
                             e.printStackTrace();
                         }
@@ -328,7 +328,7 @@ public class MainActivity extends Activity implements
                             OcPlatform
                             .findResource(
                                     "", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "device.notify",
-                                    OcConnectivityType.CT_ADAPTER_IP, foundResource);
+                                    OcConnectivityType.CT_DEFAULT, foundResource);
                         } catch (OcException e) {
                             e.printStackTrace();
                         }
@@ -486,7 +486,7 @@ public class MainActivity extends Activity implements
                             OcPlatform
                             .findResource(
                                     "", OcPlatform.WELL_KNOWN_QUERY + "?rt=" + "device.light",
-                                    OcConnectivityType.CT_ADAPTER_IP, foundResource);
+                                    OcConnectivityType.CT_DEFAULT, foundResource);
                         } catch (OcException e) {
                             e.printStackTrace();
                         }
index cc8d826..701c148 100644 (file)
@@ -122,7 +122,7 @@ public class Activator extends Activity implements BundleActivator,
             EntityHandlerNoti entitycb = new EntityHandlerNoti();
 
             resourceHandle = OcPlatform.registerResource("/a/galaxy/gear",
-                    "device.notify", "oc.mi.def", entitycb,
+                    "device.notify", OcPlatform.DEFAULT_INTERFACE, entitycb,
                     EnumSet.of(ResourceProperty.DISCOVERABLE));
         }
         else{
index e92093c..22eb81b 100644 (file)
@@ -230,7 +230,7 @@ public class Activator extends Activity implements BundleActivator {
                                                            System.currentTimeMillis());
 
                                            PlatformConfig cfg = new PlatformConfig(
-                                                   getApplicationContext(),
+                                                   getBaseContext(),
                                                    ServiceType.IN_PROC,
                                                    ModeType.CLIENT_SERVER,
                                                    "0.0.0.0", 0,
@@ -244,7 +244,7 @@ public class Activator extends Activity implements BundleActivator {
                                                        .registerResource(
                                                                "/a/huebulb",
                                                                "device.light",
-                                                               "oc.mi.def",
+                                                               OcPlatform.DEFAULT_INTERFACE,
                                                                entitycb,
                                                                EnumSet.of(ResourceProperty.DISCOVERABLE));
                                            } catch (OcException e) {
index 6a8b465..4dbd3d0 100644 (file)
@@ -150,7 +150,7 @@ public class Activator extends Activity implements BundleActivator,
                                 .getWeMoDeviceByUDN(udn);
                         if ((listDevice != null) && (listDevice.isAvailable())) {
                             PlatformConfig cfg = new PlatformConfig(
-                                    getApplicationContext(),
+                                    getBaseContext(),
                                     ServiceType.IN_PROC,
                                     ModeType.CLIENT_SERVER, "0.0.0.0", 0,
                                     QualityOfService.LOW);
@@ -163,7 +163,7 @@ public class Activator extends Activity implements BundleActivator,
                                         .registerResource(
                                                 "/a/wemo",
                                                 "device.smartplug",
-                                                "oc.mi.def",
+                                                OcPlatform.DEFAULT_INTERFACE,
                                                 entitycb,
                                                 EnumSet.of(ResourceProperty.DISCOVERABLE));
                             } catch (OcException e) {