summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorsourav bhuwalka <s.bhuwalka@samsung.com>2018-12-11 22:52:33 +0530
committerAmit KS <amit.s12@samsung.com>2018-12-13 10:15:13 +0530
commitcadb39791ce0cf7a832b3a7425b654b035ff5308 (patch)
tree77a70dbc37c4b5dc64d05c289f36810c30baa094 /service
parentc58dd148dcb3339d6333338a7dcd1a84fb27e91b (diff)
downloadiotivity-cadb39791ce0cf7a832b3a7425b654b035ff5308.tar.gz
iotivity-cadb39791ce0cf7a832b3a7425b654b035ff5308.tar.bz2
iotivity-cadb39791ce0cf7a832b3a7425b654b035ff5308.zip
Adding more samsung specific properties
Changes: 1.Backward compatibility for "mnmo", "lang", "ctry", "loc" properties. 2.Adding OC_LOW_QOS_WITH_TCP to OCQualityOfService. 3.Adding support for new samsung specific properties: 4."x.com.samsung.serverid", "x.com.samsung.timezoneid", 5."x.com.samsung.saapiserver", "x.com.samsung.saauthserver", 6."x.com.samsung.sadsc", "x.com.samsung.hidden", "x.com.samsung.hubid" 7.Adding new WiFi Auth type - FT_PSK 8.Setting DeviceID seed while configuring stack. 9.Redundant m_observeCacheList removed from ResourceCacheManager. https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/364 (cherry picked from commit 1f00a113fcf6a7f65144d259ec4f39aac7288e02) Change-Id: I4b0712904ba2144370c0009bc3fdecc4a2a15851 Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com> Signed-off-by: Harish Kumara M <h.marappa@samsung.com> Signed-off-by: Amit KS <amit.s12@samsung.com>
Diffstat (limited to 'service')
-rw-r--r--service/easy-setup/enrollee/inc/samsung/sc_easysetup.h9
-rw-r--r--service/easy-setup/enrollee/src/samsung/sc_easysetup.c32
-rw-r--r--service/easy-setup/inc/escommon.h3
-rw-r--r--service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/enums/WIFI_AUTHTYPE.java3
-rw-r--r--service/easy-setup/mediator/richsdk/inc/ESSCCommon.h265
-rw-r--r--service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h1
-rw-r--r--service/resource-encapsulation/src/resourceCache/src/ResourceCacheManager.cpp1
7 files changed, 310 insertions, 4 deletions
diff --git a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h
index 18bd0f073..aa56a04f6 100644
--- a/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h
+++ b/service/easy-setup/enrollee/inc/samsung/sc_easysetup.h
@@ -56,6 +56,9 @@
#define SC_RSRVD_ES_VENDOR_UTC_DATE_TIME "x.com.samsung.datetime"
#define SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME "x.com.samsung.regionaldatetime"
#define SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION "x.com.samsung.espv"
+#define SC_RSRVD_ES_VENDOR_TIMEZONE_ID "x.com.samsung.timezoneid"
+#define SC_RSRVD_ES_VENDOR_HIDDEN "x.com.samsung.hidden"
+#define SC_RSRVD_ES_VENDOR_HUB_ID "x.com.samsung.hubid"
#define SC_RSRVD_ES_VENDOR_CANDIDATEAPS "x.com.samsung.candidateaps"
#define SC_RSRVD_ES_VENDOR_SSID "x.com.samsung.ssid"
#define SC_RSRVD_ES_VENDOR_PASSPHRASE "x.com.samsung.passphrase"
@@ -86,6 +89,7 @@ typedef struct SCWiFiConfProperties
{
int discoveryChannel; /**< Wi-Fi AP Channel used for fast discovery **/
char bssid[MAXLEN_STRING]; /**< Wi-Fi bssid information. **/
+ bool isHidden;
int numCandidateAP;
SCCandidateAPInfo candidateAPInfo[MAXNUM_CANDIDATE_AP];
} SCWiFiConfProperties;
@@ -110,6 +114,8 @@ typedef struct SCDevConfProperties
char gpsLocation[MAXLEN_STRING]; /**< GPS information of device. Longitude and latitude in json format **/
char utcDateTime[MAXLEN_DATE_TIME]; /**< UTC date time **/
char regionalDateTime[MAXLEN_DATE_TIME]; /**< Regional date time **/
+ char timeZoneId[MAXLEN_STRING]; /** Name of Time Zone **/
+ char hubId[MAXLEN_STRING]; /** HubId of device **/
} SCDevConfProperties;
typedef struct SCCoapCloudServerConfProperties
@@ -150,6 +156,9 @@ typedef struct SCProperties
char utcDateTime[MAXLEN_DATE_TIME]; /**< UTC date time **/
char regionalDateTime[MAXLEN_DATE_TIME]; /**< Regional date time **/
char esProtocolVersion[MAXLEN_STRING]; /**< Samsung Easy Setup Protocol Version **/
+ char timeZoneId[MAXLEN_STRING];
+ bool isHidden;
+ char hubId[MAXLEN_STRING]; /**< HubId of device **/
int numCandidateAP;
SCCandidateAPInfo candidateAPInfo[MAXNUM_CANDIDATE_AP];
} SCProperties;
diff --git a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c
index b4cdc0e96..7ebdbeef1 100644
--- a/service/easy-setup/enrollee/src/samsung/sc_easysetup.c
+++ b/service/easy-setup/enrollee/src/samsung/sc_easysetup.c
@@ -258,6 +258,7 @@ void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata)
{
int64_t channel = -1;
char *bssid = NULL;
+ bool isHidden = false;
if (OCRepPayloadGetPropInt(payload, SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, &channel))
{
if(*userdata == NULL)
@@ -355,6 +356,24 @@ void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata)
pWifiConfProp->numCandidateAP = (int)dimensions[0];
g_SCProperties.numCandidateAP = (int)dimensions[0];
}
+
+ if (OCRepPayloadGetPropBool(payload, SC_RSRVD_ES_VENDOR_HIDDEN, &isHidden))
+ {
+ if(*userdata == NULL)
+ {
+ *userdata = (void*)OICMalloc(sizeof(SCWiFiConfProperties));
+ if( *userdata == NULL )
+ {
+ OIC_LOG(ERROR, SC_ENROLLEE_TAG, "OICMalloc for SCWiFiConfProperties is failed");
+ return ;
+ }
+ memset(*userdata, 0, sizeof(SCWiFiConfProperties));
+ }
+ OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "[User specific property] %s : %d",
+ SC_RSRVD_ES_VENDOR_HIDDEN, isHidden);
+ ((SCWiFiConfProperties*)(*userdata))->isHidden = isHidden;
+ g_SCProperties.isHidden = isHidden;
+ }
}
else if(strstr(resourceType, OC_RSRVD_ES_RES_TYPE_DEVCONF))
{
@@ -438,6 +457,14 @@ void ReadUserdataCb(OCRepPayload* payload, char* resourceType, void** userdata)
OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.regionalDateTime %s", g_SCProperties.regionalDateTime);
}
+ char *timeZoneId = NULL;
+ if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_TIMEZONE_ID, &timeZoneId))
+ {
+ OICStrcpy(pDevConfProp->timeZoneId, strlen(timeZoneId)+1, timeZoneId);
+ OICStrcpy(g_SCProperties.timeZoneId, strlen(timeZoneId)+1, timeZoneId);
+ OIC_LOG_V(INFO_PRIVATE, SC_ENROLLEE_TAG, "pDevConfProp.timeZoneId %s", g_SCProperties.timeZoneId);
+ }
+
char *ssoList = NULL;
if (OCRepPayloadGetPropString(payload, SC_RSRVD_ES_VENDOR_SSO_LIST, &ssoList))
{
@@ -622,6 +649,7 @@ void WriteUserdataCb(OCRepPayload* payload, char* resourceType)
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, g_SCProperties.utcDateTime);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, g_SCProperties.regionalDateTime);
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
+ OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_HUB_ID, g_SCProperties.hubId);
#else
if(g_SCProperties.deviceType != NULL)
{
@@ -671,6 +699,10 @@ void WriteUserdataCb(OCRepPayload* payload, char* resourceType)
{
OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION, g_SCProperties.esProtocolVersion);
}
+ if (g_SCProperties.hubId != NULL)
+ {
+ OCRepPayloadSetPropString(payload, SC_RSRVD_ES_VENDOR_HUB_ID, g_SCProperties.hubId);
+ }
#endif
}
}
diff --git a/service/easy-setup/inc/escommon.h b/service/easy-setup/inc/escommon.h
index 1ce4c1c6e..94c5df14c 100644
--- a/service/easy-setup/inc/escommon.h
+++ b/service/easy-setup/inc/escommon.h
@@ -109,7 +109,8 @@ typedef enum
NONE_AUTH = 0, /**< NO authentication **/
WEP, /**< WEP **/
WPA_PSK, /**< WPA-PSK **/
- WPA2_PSK /**< WPA2-PSK **/
+ WPA2_PSK, /**< WPA2-PSK **/
+ FT_PSK /**< FT-PSK **/
} WIFI_AUTHTYPE;
/**
diff --git a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/enums/WIFI_AUTHTYPE.java b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/enums/WIFI_AUTHTYPE.java
index f655048d4..90cf3db78 100644
--- a/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/enums/WIFI_AUTHTYPE.java
+++ b/service/easy-setup/mediator/richsdk/android/EasySetupCore/src/main/java/org/iotivity/service/easysetup/mediator/enums/WIFI_AUTHTYPE.java
@@ -30,7 +30,8 @@ public enum WIFI_AUTHTYPE
NONE_AUTH(0),
WEP(1),
WPA_PSK(2),
- WPA2_PSK(3);
+ WPA2_PSK(3),
+ FT_PSK(4);
private int value;
diff --git a/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h b/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h
index 68e4dbaf6..db59319ea 100644
--- a/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h
+++ b/service/easy-setup/mediator/richsdk/inc/ESSCCommon.h
@@ -35,6 +35,9 @@ using namespace std;
#define SC_RSRVD_ES_VENDOR_ACCOUNT "x.com.samsung.account"
#define SC_RSRVD_ES_VENDOR_SSO_LIST "x.com.samsung.ssolist"
#define SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE "x.com.samsung.aac"
+#define SC_RSRVD_ES_VENDOR_SA_API_SERVER "x.com.samsung.saapiserver"
+#define SC_RSRVD_ES_VENDOR_SA_AUTH_SERVER "x.com.samsung.saauthserver"
+#define SC_RSRVD_ES_VENDOR_SA_DEVICE_SECURITY_CODE "x.com.samsung.sadsc"
#define SC_RSRVD_ES_VENDOR_ACCESS_TOKEN "x.com.samsung.accesstoken"
#define SC_RSRVD_ES_VENDOR_REFRESH_TOKEN "x.com.samsung.refreshtoken"
#define SC_RSRVD_ES_VENDOR_UTC_DATE_TIME "x.com.samsung.datetime"
@@ -54,6 +57,15 @@ using namespace std;
#define SC_RSRVD_ES_VENDOR_COUNTRY "x.com.samsung.country"
#define SC_RSRVD_ES_VENDOR_GPSLOCATION "x.com.samsung.gpslocation"
#define SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION "x.com.samsung.espv"
+#define SC_RSRVD_ES_VENDOR_MODEL_NUMBER_OLD "mnmo"
+#define SC_RSRVD_ES_VENDOR_LANGUAGE_OLD "lang"
+#define SC_RSRVD_ES_VENDOR_COUNTRY_OLD "ctry"
+#define SC_RSRVD_ES_VENDOR_GPSLOCATION_OLD "loc"
+#define SC_RSRVD_ES_VENDOR_SERVER_ID "x.com.samsung.serverid"
+#define SC_RSRVD_ES_VENDOR_TIMEZONE_ID "x.com.samsung.timezoneid"
+#define SC_RSRVD_ES_VENDOR_HIDDEN "x.com.samsung.hidden"
+#define SC_RSRVD_ES_VENDOR_HUB_ID "x.com.samsung.hubid"
+#define SC_RSRVD_ES_VENDOR_SERVER_DEPLOYMENT_ENVIRONMENT "x.com.samsung.deployenv"
#define SC_RSRVD_ES_VENDOR_CANDIDATEAPS "x.com.samsung.candidateaps"
#define SC_RSRVD_ES_VENDOR_SSID "x.com.samsung.ssid"
#define SC_RSRVD_ES_VENDOR_PASSPHRASE "x.com.samsung.passphrase"
@@ -160,6 +172,11 @@ namespace OIC
m_rep.setValue(SC_RSRVD_ES_VENDOR_LANGUAGE, language);
m_rep.setValue(SC_RSRVD_ES_VENDOR_COUNTRY, country);
m_rep.setValue(SC_RSRVD_ES_VENDOR_GPSLOCATION, location);
+
+ /* [CONPRO-888] Support backward compatibility */
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_LANGUAGE_OLD, language);
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_COUNTRY_OLD, country);
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_GPSLOCATION_OLD, location);
}
/**
@@ -174,6 +191,10 @@ namespace OIC
{
return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_LANGUAGE);
}
+ else if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_LANGUAGE_OLD))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_LANGUAGE_OLD);
+ }
return std::string("");
}
@@ -189,6 +210,10 @@ namespace OIC
{
return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_COUNTRY);
}
+ else if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_COUNTRY_OLD))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_COUNTRY_OLD);
+ }
return std::string("");
}
@@ -203,6 +228,10 @@ namespace OIC
{
return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_GPSLOCATION);
}
+ else if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_GPSLOCATION_OLD))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_GPSLOCATION_OLD);
+ }
return std::string("");
}
@@ -435,6 +464,55 @@ namespace OIC
}
return {};
}
+
+ /**
+ * Set time zone for location based services when easy-setup is done
+ *
+ * @param Name of timeZone
+ */
+ void setTimeZoneId(const std::string &timeZoneId)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_TIMEZONE_ID, timeZoneId);
+ }
+
+ /**
+ * Get the Name of TimeZone
+ *
+ * @return Name of timeZone
+ */
+ std::string getTimeZoneId()
+ {
+ if (m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_TIMEZONE_ID))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TIMEZONE_ID);
+ }
+ return {};
+ }
+
+ /**
+ * Sets the hidden property of wifi
+ * if the Value is true, wifi is a hidden wifi, otherwise it is not
+ *
+ * @param isHidden: value indicating whether the wifi is hidden or not
+ */
+ void setHiddenProperty(bool isHidden)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_HIDDEN, isHidden);
+ }
+
+ /**
+ * Gets the property of the wifi whether it is hidden or not
+ *
+ * @return hidden value indicating whether the wifi is hidden or not
+ */
+ bool getHiddenProperty()
+ {
+ if (m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_HIDDEN))
+ {
+ return m_rep.getValue<bool>(SC_RSRVD_ES_VENDOR_HIDDEN);
+ }
+ return false;
+ }
};
class SCCloudProp : public CloudProp
@@ -475,6 +553,102 @@ namespace OIC
}
/**
+ * Set samsung-specific additional Api provider to be delivered to Enrollee (for devices(TV/AV, Lux) sign up SSO)
+ *
+ * @param additionalApiProvider - additional Api Provider
+ */
+ void setAdditionalApiProvider(const std::string &additionalApiProvider)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SA_API_SERVER, additionalApiProvider);
+ }
+
+ /**
+ * Get samsung-specific additional Api provider (for devices(TV/AV, Lux) sign up SSO)
+ *
+ * @return additionalApiProvider - additional Api Provider
+ */
+ std::string getAdditionalApiProvider()
+ {
+ if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SA_API_SERVER))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SA_API_SERVER);
+ }
+ return {};
+ }
+
+ /**
+ * Set samsung-specific additional Auth provider to be delivered to Enrollee (for devices(TV/AV, Lux) sign up SSO)
+ *
+ * @param additionalAuthProvider - additional Auth Provider
+ */
+ void setAdditionalAuthProvider(const std::string &additionalAuthProvider)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SA_AUTH_SERVER, additionalAuthProvider);
+ }
+
+ /**
+ * Get samsung-specific additional Auth provider (for devices(TV/AV, Lux) sign up SSO)
+ *
+ * @return additionalAuthProvider - additional Auth Provider
+ */
+ std::string getAdditionalAuthProvider()
+ {
+ if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SA_AUTH_SERVER))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SA_AUTH_SERVER);
+ }
+ return {};
+ }
+
+ /**
+ * Set samsung-specific additional device security code to be delivered to Enrollee (for devices(TV/AV, Lux) sign up SSO)
+ *
+ * @param additionalDeviceSecCode - additional DeviceSecurityCode (for devices(TV/AV, Lux) sign up VD SSO)
+ */
+ void setAdditionalDeviceSecCode(const std::string &additionalDeviceSecCode)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SA_DEVICE_SECURITY_CODE, additionalDeviceSecCode);
+ }
+
+ /**
+ * Get samsung-specific additional device security code
+ *
+ * @return additionalDeviceSecCode - additional DeviceSecurityCode
+ */
+ std::string getAdditionalDeviceSecCode()
+ {
+ if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SA_DEVICE_SECURITY_CODE))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SA_DEVICE_SECURITY_CODE);
+ }
+ return {};
+ }
+
+ /**
+ * Set current deployment environment which IoT Server is operating such as "PRD" "STG"
+ *
+ * @param serverDeploymentEnv - current server Deployment Environment
+ */
+ void setServerDeploymentEnv(const std::string &serverDeploymentEnv)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SERVER_DEPLOYMENT_ENVIRONMENT, serverDeploymentEnv);
+ }
+
+ /**
+ * Get current server deployment environment which IoT Server is operating such as "PRD", "STG" etc
+ *
+ * @return serverDeploymentEnv - current server deployment environment
+ */
+ std::string getServerDeploymentEnv()
+ {
+ if (m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SERVER_DEPLOYMENT_ENVIRONMENT))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SERVER_DEPLOYMENT_ENVIRONMENT);
+ }
+ return {};
+ }
+
+ /**
* Set samsung-specific refresh token property to be delivered to Enrollee
*
* @param refreshtoken - Refresh token.
@@ -546,6 +720,30 @@ namespace OIC
}
return {};
}
+
+ /**
+ * Set samsung-specific client service ID property to be delivered to Enrollee
+ *
+ * @param clientID - Client service ID
+ */
+ void setServerId(const std::string &serverId)
+ {
+ m_rep.setValue(SC_RSRVD_ES_VENDOR_SERVER_ID, serverId);
+ }
+
+ /**
+ * Get samsung-specific client service ID property.
+ *
+ * @return Client service ID.
+ */
+ std::string getServerId()
+ {
+ if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SERVER_ID))
+ {
+ return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SERVER_ID);
+ }
+ return {};
+ }
};
/**
@@ -587,6 +785,10 @@ namespace OIC
{
return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_MODEL_NUMBER);
}
+ else if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_MODEL_NUMBER_OLD))
+ {
+ return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_MODEL_NUMBER_OLD);
+ }
}
}
return std::string("");
@@ -1090,6 +1292,69 @@ namespace OIC
return std::string("");
}
+ /**
+ * Gets the ISO country code of the device
+ * (ISO 3166-1 Alpha-2)
+ *
+ * @return the ISO Country code of the device
+ */
+ std::string getCountry() const
+ {
+ std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
+ for(auto child = children.begin(); child != children.end(); ++child)
+ {
+ if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
+ {
+ OCRepresentation rep;
+ if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
+ {
+ rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
+ }
+ else
+ {
+ return std::string("");
+ }
+
+ if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_COUNTRY))
+ {
+ return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_COUNTRY);
+ }
+ }
+ }
+ return std::string("");
+ }
+
+ /**
+ * Gets the HubId of the device
+ *
+ * @return hubId of the device
+ */
+ std::string getHubId() const
+ {
+ std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
+ for(auto child = children.begin(); child != children.end(); ++child)
+ {
+ if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
+ {
+ OCRepresentation rep;
+ if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
+ {
+ rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
+ }
+ else
+ {
+ return std::string("");
+ }
+
+ if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_HUB_ID))
+ {
+ return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_HUB_ID);
+ }
+ }
+ }
+ return std::string("");
+ }
+
};
}
}
diff --git a/service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h b/service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h
index ae02caca2..01b99219b 100644
--- a/service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h
+++ b/service/resource-encapsulation/src/resourceCache/include/ResourceCacheManager.h
@@ -75,7 +75,6 @@ namespace OIC
static std::unique_ptr<std::list<DataCachePtr>> s_cacheDataList;
std::map<CacheID, DataCachePtr> cacheIDmap;
- std::list<ObserveCache::Ptr> m_observeCacheList;
std::map<CacheID, ObserveCache::Ptr> observeCacheIDmap;
ResourceCacheManager() = default;
diff --git a/service/resource-encapsulation/src/resourceCache/src/ResourceCacheManager.cpp b/service/resource-encapsulation/src/resourceCache/src/ResourceCacheManager.cpp
index efe0cde2c..8a3f02019 100644
--- a/service/resource-encapsulation/src/resourceCache/src/ResourceCacheManager.cpp
+++ b/service/resource-encapsulation/src/resourceCache/src/ResourceCacheManager.cpp
@@ -88,7 +88,6 @@ namespace OIC
auto newHandler = std::make_shared<ObserveCache>(pResource);
newHandler->startCache(std::move(func));
- m_observeCacheList.push_back(newHandler);
observeCacheIDmap.insert(std::make_pair(retID, newHandler));
return retID;