|
@@ -15,7 +15,9 @@ import org.iotivity.bridge.homeserver.model.OCFDevice;
|
|
|
import org.iotivity.oc.OcCborEncoder;
|
|
|
import org.iotivity.oc.OcUtils;
|
|
|
|
|
|
+import java.util.Enumeration;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.Hashtable;
|
|
|
import java.util.Iterator;
|
|
|
import java.util.Properties;
|
|
|
|
|
@@ -57,12 +59,14 @@ public class GetRequestHandler implements OCRequestHandler {
|
|
|
|
|
|
// return current value/state of device
|
|
|
OCFDevice.Resource resource = device.getResource(request.getResource().getUri());
|
|
|
+ Log.d(TAG, "Get "+request.getResource().getUri()+" Resource's properties : " + device.getProperties(request.getResource().getUri()));
|
|
|
+
|
|
|
if(resource!=null) {
|
|
|
Properties properties = resource.getProperties();
|
|
|
- Iterator<String> it = properties.stringPropertyNames().iterator();
|
|
|
- while(it.hasNext()) {
|
|
|
- String key = it.next();
|
|
|
+ for (Enumeration<String> e = (Enumeration<String>)properties.propertyNames(); e.hasMoreElements() ;) {
|
|
|
+ String key = e.nextElement();
|
|
|
Object value = properties.get(key);
|
|
|
+ //Log.d(TAG, "Properties key="+key+", value="+value+", value instance="+ value.getClass().getCanonicalName());
|
|
|
service.msg("\t\t" + key + ": " + value);
|
|
|
if(value instanceof Boolean) {
|
|
|
root.setBoolean(key, (boolean)value);
|