- try {
- if (mWiFiRep != null && mWiFiRep.hasAttribute(ESConstants.OC_RSRVD_ES_SUPPORTEDWIFIMODE)) {
- int modes_int[] = mWiFiRep.getValue(ESConstants.OC_RSRVD_ES_SUPPORTEDWIFIMODE);
- for (int i = 0 ; i < modes_int.length ; ++i) {
- modes.add(WIFI_MODE.fromInt(modes_int[i]));
+ for (OcRepresentation child : children) {
+ if(child.getUri().indexOf(ESConstants.OC_RSRVD_ES_URI_WIFICONF) != -1)
+ {
+ try {
+ OcRepresentation rep;
+ if(child.hasAttribute(ESConstants.OC_RSRVD_REPRESENTATION))
+ {
+ rep = (OcRepresentation)child.getValue(ESConstants.OC_RSRVD_REPRESENTATION);
+ }
+ else
+ {
+ return null;
+ }
+
+ if (rep.hasAttribute(ESConstants.OC_RSRVD_ES_SUPPORTEDWIFIMODE)) {
+ int modes_int[] = rep.getValue(ESConstants.OC_RSRVD_ES_SUPPORTEDWIFIMODE);
+ for (int i = 0 ; i < modes_int.length ; ++i) {
+ modes.add(WIFI_MODE.fromInt(modes_int[i]));
+ }
+ }
+ } catch (OcException e) {
+ Log.e(TAG, "getWiFiModes is failed.");