1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef ESSC_COMMON_RICH_H_
22 #define ESSC_COMMON_RICH_H_
24 #include "ESRichCommon.h"
29 #define SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE "x.com.samsung.ncs"
30 #define SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL "x.com.samsung.chn"
31 #define SC_RSRVD_ES_VENDOR_DEVICE_TYPE "x.com.samsung.dt"
32 #define SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE "x.com.samsung.sdt"
33 #define SC_RSRVD_ES_VENDOR_LOCATION "x.com.samsung.location"
34 #define SC_RSRVD_ES_VENDOR_CLIENTID "x.com.samsung.clientid"
35 #define SC_RSRVD_ES_VENDOR_ACCOUNT "x.com.samsung.account"
36 #define SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE "x.com.samsung.aac"
37 #define SC_RSRVD_ES_VENDOR_ACCESS_TOKEN "x.com.samsung.accesstoken"
38 #define SC_RSRVD_ES_VENDOR_REFRESH_TOKEN "x.com.samsung.refreshtoken"
39 #define SC_RSRVD_ES_VENDOR_UTC_DATE_TIME "x.com.samsung.datetime"
40 #define SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME "x.com.samsung.regionaldatetime"
41 #define SC_RSRVD_ES_VENDOR_BSSID "x.com.samsung.bssid"
42 #define SC_RSRVD_ES_VENDOR_USERID "x.com.samsung.uid"
43 #define SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV "x.com.samsung.rmd"
44 #define SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV "x.com.samsung.rsd"
45 #define SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO "x.com.samsung.npi"
46 #define SC_RSRVD_ES_VENDOR_TC_STATUS "x.com.samsung.tcstatus"
47 #define SC_RSRVD_ES_VENDOR_TC_HEADER "x.com.samsung.tcheader"
48 #define SC_RSRVD_ES_VENDOR_TC_VERSION "x.com.samsung.tcversion"
49 #define SC_RSRVD_ES_VENDOR_TC_RESULT "x.com.samsung.tcresult"
50 #define SC_RSRVD_ES_VENDOR_PNP_PIN "x.com.samsung.pnppin"
51 #define SC_RSRVD_ES_VENDOR_MODEL_NUMBER "x.com.samsung.modelnumber"
52 #define SC_RSRVD_ES_VENDOR_LANGUAGE "x.com.samsung.language"
53 #define SC_RSRVD_ES_VENDOR_COUNTRY "x.com.samsung.country"
54 #define SC_RSRVD_ES_VENDOR_GPSLOCATION "x.com.samsung.gpslocation"
55 #define SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION "x.com.samsung.espv"
63 #define INVALID_DISCOVERY_CHANNEL -1
67 NET_STATE_INIT = -1, /**< Init state **/
68 NET_STATE_WIRED_CONNECTED = 0, /**< Wired connected **/
69 NET_STATE_WIRELESS_CONNECTED, /**< Wireless connected **/
70 NET_STATE_NOT_CONNECTED /**< Not connected, at all **/
71 } NETCONNECTION_STATE;
75 TC_STATUS_NOT_SUPPORTED = 0,
76 TC_STATUS_ALREADY_AGREED,
77 TC_STATUS_NEED_TO_AGREE,
78 TC_STATUS_DOWNLOADING_TC,
79 TC_STATUS_SUCCESS_TO_DOWNLOAD_TC,
80 TC_STATUS_FAIL_TO_DOWNLOAD_TC,
81 TC_STATUS_DISAGREED_WITH_TC,
82 TC_STATUS_GEO_BLOCKED,
83 TC_STATUS_TIMEOUT_TO_AGREE
87 * @brief Properties of provisioning resource. It includes a provisioning status and last
90 class SCEnrolleeStatus : public EnrolleeStatus
93 SCEnrolleeStatus(const EnrolleeStatus&& parent) : EnrolleeStatus(parent)
98 * Get a network connection state property of Enrollee.
100 * @return a network connection state property of Enrollee.
102 NETCONNECTION_STATE getNetConnectionState() const
104 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE))
106 return static_cast<NETCONNECTION_STATE>
107 (m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE));
109 return NETCONNECTION_STATE::NET_STATE_INIT;
119 TC_STATUS getTCStatus()
121 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_STATUS))
123 return static_cast<TC_STATUS>
124 (m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_TC_STATUS));
127 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
132 * @brief Data class stored for Device property provisioning which includes a WiFi
133 * and device configuration provisioning
135 class SCDeviceProp : public DeviceProp
140 * Set DevConf resource properties to be delivered to Enrollee
142 * @param language IETF language tag using ISO 639X
143 * @param country ISO Country Code (ISO 3166-1 Alpha-2)
144 * @param location location information
146 void setDevConfProp(string language, string country, string location)
148 m_rep.setValue(SC_RSRVD_ES_VENDOR_LANGUAGE, language);
149 m_rep.setValue(SC_RSRVD_ES_VENDOR_COUNTRY, country);
150 m_rep.setValue(SC_RSRVD_ES_VENDOR_GPSLOCATION, location);
154 * Get a language to be set. A language is expressed in IETF language tag
157 * @return a language to be set
159 std::string getLanguage() const
161 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_LANGUAGE))
163 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_LANGUAGE);
165 return std::string("");
169 * Get a country to be set. A country is expressed in ISO Country Code
170 * (ISO 3166-1 Alpha-2)
172 * @return a country to be set
174 std::string getCountry() const
176 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_COUNTRY))
178 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_COUNTRY);
180 return std::string("");
184 * Get a location to be set. A location is GPS information
186 * @return a country to be set
188 std::string getLocation() const
190 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_GPSLOCATION))
192 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_GPSLOCATION);
194 return std::string("");
198 * Set discoveryChannel properties to be delivered to Enrollee
200 * @param discoveryChannel Channel of the Enroller for fast discover
202 void setDiscoveryChannel(int discoveryChannel)
204 m_rep.setValue(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, discoveryChannel);
208 * Get an channel of Enroller
210 * @return an channel of enroller
212 int getDiscoveryChannel()
214 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL))
216 return m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL);
218 return INVALID_DISCOVERY_CHANNEL;
222 * Set samsung-specific location property to be delivered to Enrollee
224 * @param locations a set of location information
226 void setSCLocation(const std::vector<std::string> &locations)
228 m_rep.setValue(SC_RSRVD_ES_VENDOR_LOCATION, locations);
232 * Set samsung account property to be delivered to Enrollee (for TV)
234 * @param account a samsung account ID information (for TV)
236 void setSCAccount(const std::string &account)
238 m_rep.setValue(SC_RSRVD_ES_VENDOR_ACCOUNT, account);
242 * Set UTC date time property to be delivered to Enrollee.
243 * The format is "[yyyy]-[mm]-[dd]T[hh]:[mm]:[ss]Z"
245 * @param datetime UTC date time
247 void setUTCDatetime(const std::string &datetime)
249 m_rep.setValue(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, datetime);
253 * Get UTC date time property
255 * @return UTC date time
257 std::string getUTCDatetime()
259 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME))
261 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME);
267 * Set regional date time property to be delivered to Enrollee.
268 * The format is "[yyyy]-[mm]-[dd]T[hh]:[mm]:[ss]Z"
270 * @param datetime Regional date time
272 void setRegionalDatetime(const std::string &datetime)
274 m_rep.setValue(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, datetime);
278 * Get regional date time property
282 std::string getRegionalDatetime()
284 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME))
286 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME);
292 * Set Mobile device information used for 'register TV'
293 * The format is in json. The key indicates the meaning of value and the value is a
294 * corresponding information. Supported keys include: wm(Wifi MAC), pm(P2P MAC),
295 * bm(BT MAC), dn(device name), dt(device type), it(icon type).
297 * @param regMobileDev register mobile device
299 void setRegisterMobileDevice(const std::string ®MobileDev)
301 m_rep.setValue(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, regMobileDev);
305 * Get Mobile device information used for 'register TV'
307 * @return register mobile device
309 std::string getRegisterMobileDevice()
311 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV))
313 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV);
319 * Set a BSSID of Enroller
321 * @param a BSSID of enroller
323 void setBSSID(const std::string &bssid)
325 m_rep.setValue(SC_RSRVD_ES_VENDOR_BSSID, bssid);
329 * Get a BSSID of Enroller
331 * @return a BSSID of enroller
333 std::string getBSSID()
335 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID))
337 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_BSSID);
343 class SCCloudProp : public CloudProp
347 * Set samsung-specific client service ID property to be delivered to Enrollee
349 * @param clientID - Client service ID
351 void setClientID(const std::string &clientID)
353 m_rep.setValue(SC_RSRVD_ES_VENDOR_CLIENTID, clientID);
357 * Get samsung-specific client service ID property.
359 * @return Client service ID.
361 std::string getClientID()
363 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_CLIENTID))
365 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_CLIENTID);
371 * Set samsung-specific additional AuthCode property to be delivered to Enrollee (for TV/AV sign up VD SSO)
373 * @param additionalAuthcode - additional AuthCode (for TV/AV sign up VD SSO)
375 void setAdditionalAuthCode(const std::string &additionalAuthcode)
377 m_rep.setValue(SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE, additionalAuthcode);
381 * Set samsung-specific refresh token property to be delivered to Enrollee
383 * @param refreshtoken - Refresh token.
385 void setRefreshToken(const std::string &refreshtoken)
387 m_rep.setValue(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, refreshtoken);
391 * Get samsung-specific refresh token property.
393 * @return refreshtoken - Refresh token.
395 std::string getRefreshToken()
397 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN))
399 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN);
405 * Set samsung-specific user ID property to be delivered to Enrollee
407 * @param uid - user ID.
409 void setUserID(const std::string &uid)
411 m_rep.setValue(SC_RSRVD_ES_VENDOR_USERID, uid);
415 * Get samsung-specific user ID property
417 * @return uid - user ID.
419 std::string getUserID()
421 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_USERID))
423 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_USERID);
430 * Indicates T&C result by mobile user in json format.
432 * @param uid - user ID.
434 void setTCResult(const std::string &result)
436 m_rep.setValue(SC_RSRVD_ES_VENDOR_TC_RESULT, result);
442 * @return uid - user ID.
444 std::string getTCResult()
446 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_RESULT))
448 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_RESULT);
455 * @breif This provide a set of getter APIs from received response for getConfiguration().
456 * Received information includes a device name, WiFi supported mode, and frequency.
457 * Additionally, you can know if Enrollee can be access to cloud server with this
460 class SCEnrolleeConf : public EnrolleeConf
463 SCEnrolleeConf(const EnrolleeConf&& parent) : EnrolleeConf(parent)
468 * Get a model number of Enrollee.
470 * @return a model number of Enrollee
472 std::string getModelNumber() const
474 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
475 for(auto child = children.begin(); child != children.end(); ++child)
477 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
479 OCRepresentation rep;
480 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
482 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
486 return std::string("");
489 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_MODEL_NUMBER))
491 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_MODEL_NUMBER);
495 return std::string("");
499 * Get a device type of Enrollee.
500 * It is Device's human-friendly name like device model name.
502 * @return a device type of Enrollee
504 std::string getDeviceType() const
506 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
507 for(auto child = children.begin(); child != children.end(); ++child)
509 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
511 OCRepresentation rep;
512 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
514 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
518 return std::string("");
521 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_DEVICE_TYPE))
523 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_DEVICE_TYPE);
527 return std::string("");
531 * Get a device sub-type of Enrollee.
532 * It is Device's human-friendly name like device model name.
534 * @return a device sub-type of Enrollee
536 std::string getDeviceSubType() const
538 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
539 for(auto child = children.begin(); child != children.end(); ++child)
541 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
543 OCRepresentation rep;
544 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
546 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
550 return std::string("");
553 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE))
555 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE);
559 return std::string("");
563 * Get Set device information used for 'register TV'
564 * The format is in json. The key indicates the meaning of value and the value is a
565 * corresponding information. Supported keys include: wm(Wifi MAC), pm(P2P MAC),
566 * bm(BT MAC), rt(Remote Type)
568 * @return Register Set Device
570 std::string getRegisterSetDevice() const
572 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
573 for(auto child = children.begin(); child != children.end(); ++child)
575 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
577 OCRepresentation rep;
578 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
580 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
584 return std::string("");
587 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV))
589 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV);
593 return std::string("");
597 * Get network provisioning information for the device.
598 * Mediator can use this information to enquire & validate registration status with corresponding Network Vendor.
599 * The format is in JSON. The key indicates the meaning of value and the value is a
600 * corresponding information. Supported keys include: IMEI (IMEI Number), IMSI (IMSI Number),
601 * MCC_MNC(MCC & MNC Number), SN(Serial Number)
603 * @return Network Provisioning Information String.
605 std::string getNetworkProvisioningInfo() const
607 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
608 for(auto child = children.begin(); child != children.end(); ++child)
610 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
612 OCRepresentation rep;
613 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
615 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
619 return std::string("");
622 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO))
624 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO);
628 return std::string("");
633 * Indicates T&C is already agreed or not.
639 TC_STATUS getTCStatus()
641 OCRepresentation rep;
642 if(m_EasySetupRep.hasAttribute(OC_RSRVD_REPRESENTATION))
644 rep = m_EasySetupRep.getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
648 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
651 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_STATUS))
653 return static_cast<TC_STATUS>
654 (rep.getValue<int>(SC_RSRVD_ES_VENDOR_TC_STATUS));
657 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
662 * T&C Header Information in json format
666 std::string getTCHeader()
668 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
669 for(auto child = children.begin(); child != children.end(); ++child)
671 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
673 OCRepresentation rep;
674 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
676 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
680 return std::string("");
683 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_HEADER))
685 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_HEADER);
689 return std::string("");
695 * @return T&C Version
697 std::string getTCVersion()
699 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
700 for(auto child = children.begin(); child != children.end(); ++child)
702 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
704 OCRepresentation rep;
705 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
707 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
711 return std::string("");
714 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_VERSION))
716 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_VERSION);
720 return std::string("");
728 std::string getPnpPin() const
730 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
731 for(auto child = children.begin(); child != children.end(); ++child)
733 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
735 OCRepresentation rep;
736 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
738 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
742 return std::string("");
745 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_PNP_PIN))
747 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_PNP_PIN);
751 return std::string("");
755 * Get a network connection state property of Enrollee.
757 * @return a network connection state property of Enrollee.
759 NETCONNECTION_STATE getNetConnectionState() const
761 OCRepresentation rep;
762 if(m_EasySetupRep.hasAttribute(OC_RSRVD_REPRESENTATION))
764 rep = m_EasySetupRep.getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
768 return NETCONNECTION_STATE::NET_STATE_INIT;
771 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE))
773 return static_cast<NETCONNECTION_STATE>
774 (rep.getValue<int>(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE));
777 return NETCONNECTION_STATE::NET_STATE_INIT;
781 * Get a BSSID of Enroller
783 * @return a BSSID of enroller
785 std::string getBSSID() const
787 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
788 for(auto child = children.begin(); child != children.end(); ++child)
790 if(child->getUri().find(OC_RSRVD_ES_URI_WIFICONF) != std::string::npos)
792 OCRepresentation rep;
793 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
795 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
799 return std::string("");
802 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID))
804 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_BSSID);
814 * @return UTC date time
816 std::string getUTCDatetime() const
818 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
819 for(auto child = children.begin(); child != children.end(); ++child)
821 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
823 OCRepresentation rep;
824 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
826 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
830 return std::string("");
833 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME))
835 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME);
843 * Get regional date time
847 std::string getRegionalDatetime() const
849 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
850 for(auto child = children.begin(); child != children.end(); ++child)
852 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
854 OCRepresentation rep;
855 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
857 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
861 return std::string("");
864 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME))
866 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME);
874 * Get Samsung Easy Setup Protocol Version.
876 * Mediator can use this API to differentiate between Easy Setup Protcol supported by
877 * Samsung Enrollee Devices.
879 * Example: Version Value for Tizen4.0: [
\932.0
\94]
881 * @return Easy Setup Protocol Version String.
883 std::string getESProtocolVersion() const
885 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
886 for(auto child = children.begin(); child != children.end(); ++child)
888 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
890 OCRepresentation rep;
891 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
893 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
897 return std::string("");
900 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION))
902 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION);
906 return std::string("");
913 #endif //ESSC_COMMON_RICH_H_