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_SSO_LIST "x.com.samsung.ssolist"
37 #define SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE "x.com.samsung.aac"
38 #define SC_RSRVD_ES_VENDOR_ACCESS_TOKEN "x.com.samsung.accesstoken"
39 #define SC_RSRVD_ES_VENDOR_REFRESH_TOKEN "x.com.samsung.refreshtoken"
40 #define SC_RSRVD_ES_VENDOR_UTC_DATE_TIME "x.com.samsung.datetime"
41 #define SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME "x.com.samsung.regionaldatetime"
42 #define SC_RSRVD_ES_VENDOR_BSSID "x.com.samsung.bssid"
43 #define SC_RSRVD_ES_VENDOR_USERID "x.com.samsung.uid"
44 #define SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV "x.com.samsung.rmd"
45 #define SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV "x.com.samsung.rsd"
46 #define SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO "x.com.samsung.npi"
47 #define SC_RSRVD_ES_VENDOR_TC_STATUS "x.com.samsung.tcstatus"
48 #define SC_RSRVD_ES_VENDOR_TC_HEADER "x.com.samsung.tcheader"
49 #define SC_RSRVD_ES_VENDOR_TC_VERSION "x.com.samsung.tcversion"
50 #define SC_RSRVD_ES_VENDOR_TC_RESULT "x.com.samsung.tcresult"
51 #define SC_RSRVD_ES_VENDOR_PNP_PIN "x.com.samsung.pnppin"
52 #define SC_RSRVD_ES_VENDOR_MODEL_NUMBER "x.com.samsung.modelnumber"
53 #define SC_RSRVD_ES_VENDOR_LANGUAGE "x.com.samsung.language"
54 #define SC_RSRVD_ES_VENDOR_COUNTRY "x.com.samsung.country"
55 #define SC_RSRVD_ES_VENDOR_GPSLOCATION "x.com.samsung.gpslocation"
56 #define SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION "x.com.samsung.espv"
64 #define INVALID_DISCOVERY_CHANNEL -1
68 NET_STATE_INIT = -1, /**< Init state **/
69 NET_STATE_WIRED_CONNECTED = 0, /**< Wired connected **/
70 NET_STATE_WIRELESS_CONNECTED, /**< Wireless connected **/
71 NET_STATE_NOT_CONNECTED /**< Not connected, at all **/
72 } NETCONNECTION_STATE;
76 TC_STATUS_NOT_SUPPORTED = 0,
77 TC_STATUS_ALREADY_AGREED,
78 TC_STATUS_NEED_TO_AGREE,
79 TC_STATUS_DOWNLOADING_TC,
80 TC_STATUS_SUCCESS_TO_DOWNLOAD_TC,
81 TC_STATUS_FAIL_TO_DOWNLOAD_TC,
82 TC_STATUS_DISAGREED_WITH_TC,
83 TC_STATUS_GEO_BLOCKED,
84 TC_STATUS_TIMEOUT_TO_AGREE
88 * @brief Properties of provisioning resource. It includes a provisioning status and last
91 class SCEnrolleeStatus : public EnrolleeStatus
94 SCEnrolleeStatus(const EnrolleeStatus&& parent) : EnrolleeStatus(parent)
99 * Get a network connection state property of Enrollee.
101 * @return a network connection state property of Enrollee.
103 NETCONNECTION_STATE getNetConnectionState() const
105 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE))
107 return static_cast<NETCONNECTION_STATE>
108 (m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE));
110 return NETCONNECTION_STATE::NET_STATE_INIT;
120 TC_STATUS getTCStatus()
122 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_STATUS))
124 return static_cast<TC_STATUS>
125 (m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_TC_STATUS));
128 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
133 * @brief Data class stored for Device property provisioning which includes a WiFi
134 * and device configuration provisioning
136 class SCDeviceProp : public DeviceProp
141 * Set DevConf resource properties to be delivered to Enrollee
143 * @param language IETF language tag using ISO 639X
144 * @param country ISO Country Code (ISO 3166-1 Alpha-2)
145 * @param location location information
147 void setDevConfProp(string language, string country, string location)
149 m_rep.setValue(SC_RSRVD_ES_VENDOR_LANGUAGE, language);
150 m_rep.setValue(SC_RSRVD_ES_VENDOR_COUNTRY, country);
151 m_rep.setValue(SC_RSRVD_ES_VENDOR_GPSLOCATION, location);
155 * Get a language to be set. A language is expressed in IETF language tag
158 * @return a language to be set
160 std::string getLanguage() const
162 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_LANGUAGE))
164 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_LANGUAGE);
166 return std::string("");
170 * Get a country to be set. A country is expressed in ISO Country Code
171 * (ISO 3166-1 Alpha-2)
173 * @return a country to be set
175 std::string getCountry() const
177 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_COUNTRY))
179 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_COUNTRY);
181 return std::string("");
185 * Get a location to be set. A location is GPS information
187 * @return a country to be set
189 std::string getLocation() const
191 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_GPSLOCATION))
193 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_GPSLOCATION);
195 return std::string("");
199 * Set discoveryChannel properties to be delivered to Enrollee
201 * @param discoveryChannel Channel of the Enroller for fast discover
203 void setDiscoveryChannel(int discoveryChannel)
205 m_rep.setValue(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL, discoveryChannel);
209 * Get an channel of Enroller
211 * @return an channel of enroller
213 int getDiscoveryChannel()
215 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL))
217 return m_rep.getValue<int>(SC_RSRVD_ES_VENDOR_DISCOVERY_CHANNEL);
219 return INVALID_DISCOVERY_CHANNEL;
223 * Set samsung-specific location property to be delivered to Enrollee
225 * @param locations a set of location information
227 void setSCLocation(const std::vector<std::string> &locations)
229 m_rep.setValue(SC_RSRVD_ES_VENDOR_LOCATION, locations);
233 * Set samsung account property to be delivered to Enrollee (for TV)
235 * @param account a samsung account ID information (for TV)
237 void setSCAccount(const std::string &account)
239 m_rep.setValue(SC_RSRVD_ES_VENDOR_ACCOUNT, account);
243 * Set UTC date time property to be delivered to Enrollee.
244 * The format is "[yyyy]-[mm]-[dd]T[hh]:[mm]:[ss]Z"
246 * @param datetime UTC date time
248 void setUTCDatetime(const std::string &datetime)
250 m_rep.setValue(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME, datetime);
254 * Get UTC date time property
256 * @return UTC date time
258 std::string getUTCDatetime()
260 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME))
262 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME);
268 * Set regional date time property to be delivered to Enrollee.
269 * The format is "[yyyy]-[mm]-[dd]T[hh]:[mm]:[ss]Z"
271 * @param datetime Regional date time
273 void setRegionalDatetime(const std::string &datetime)
275 m_rep.setValue(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME, datetime);
279 * Get regional date time property
283 std::string getRegionalDatetime()
285 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME))
287 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME);
293 * Set Mobile device information used for 'register TV'
294 * The format is in json. The key indicates the meaning of value and the value is a
295 * corresponding information. Supported keys include: wm(Wifi MAC), pm(P2P MAC),
296 * bm(BT MAC), dn(device name), dt(device type), it(icon type).
298 * @param regMobileDev register mobile device
300 void setRegisterMobileDevice(const std::string ®MobileDev)
302 m_rep.setValue(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV, regMobileDev);
306 * Get Mobile device information used for 'register TV'
308 * @return register mobile device
310 std::string getRegisterMobileDevice()
312 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV))
314 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGISTER_MOBILE_DEV);
320 * Set a BSSID of Enroller
322 * @param a BSSID of enroller
324 void setBSSID(const std::string &bssid)
326 m_rep.setValue(SC_RSRVD_ES_VENDOR_BSSID, bssid);
330 * Get a BSSID of Enroller
332 * @return a BSSID of enroller
334 std::string getBSSID()
336 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID))
338 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_BSSID);
344 * Set SSO list information
348 void setSSOList(const std::string &ssoList)
350 m_rep.setValue(SC_RSRVD_ES_VENDOR_SSO_LIST, ssoList);
354 * Get SSO List information which is registered in device
358 std::string getSSOList()
360 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_SSO_LIST))
362 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SSO_LIST);
368 class SCCloudProp : public CloudProp
372 * Set samsung-specific client service ID property to be delivered to Enrollee
374 * @param clientID - Client service ID
376 void setClientID(const std::string &clientID)
378 m_rep.setValue(SC_RSRVD_ES_VENDOR_CLIENTID, clientID);
382 * Get samsung-specific client service ID property.
384 * @return Client service ID.
386 std::string getClientID()
388 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_CLIENTID))
390 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_CLIENTID);
396 * Set samsung-specific additional AuthCode property to be delivered to Enrollee (for TV/AV sign up VD SSO)
398 * @param additionalAuthcode - additional AuthCode (for TV/AV sign up VD SSO)
400 void setAdditionalAuthCode(const std::string &additionalAuthcode)
402 m_rep.setValue(SC_RSRVD_ES_VENDOR_ADDITIONAL_AUTH_CODE, additionalAuthcode);
406 * Set samsung-specific refresh token property to be delivered to Enrollee
408 * @param refreshtoken - Refresh token.
410 void setRefreshToken(const std::string &refreshtoken)
412 m_rep.setValue(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN, refreshtoken);
416 * Get samsung-specific refresh token property.
418 * @return refreshtoken - Refresh token.
420 std::string getRefreshToken()
422 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN))
424 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REFRESH_TOKEN);
430 * Set samsung-specific user ID property to be delivered to Enrollee
432 * @param uid - user ID.
434 void setUserID(const std::string &uid)
436 m_rep.setValue(SC_RSRVD_ES_VENDOR_USERID, uid);
440 * Get samsung-specific user ID property
442 * @return uid - user ID.
444 std::string getUserID()
446 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_USERID))
448 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_USERID);
455 * Indicates T&C result by mobile user in json format.
457 * @param uid - user ID.
459 void setTCResult(const std::string &result)
461 m_rep.setValue(SC_RSRVD_ES_VENDOR_TC_RESULT, result);
467 * @return uid - user ID.
469 std::string getTCResult()
471 if(m_rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_RESULT))
473 return m_rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_RESULT);
480 * @breif This provide a set of getter APIs from received response for getConfiguration().
481 * Received information includes a device name, WiFi supported mode, and frequency.
482 * Additionally, you can know if Enrollee can be access to cloud server with this
485 class SCEnrolleeConf : public EnrolleeConf
488 SCEnrolleeConf(const EnrolleeConf&& parent) : EnrolleeConf(parent)
493 * Get a model number of Enrollee.
495 * @return a model number of Enrollee
497 std::string getModelNumber() const
499 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
500 for(auto child = children.begin(); child != children.end(); ++child)
502 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
504 OCRepresentation rep;
505 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
507 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
511 return std::string("");
514 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_MODEL_NUMBER))
516 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_MODEL_NUMBER);
520 return std::string("");
524 * Get a device type of Enrollee.
525 * It is Device's human-friendly name like device model name.
527 * @return a device type of Enrollee
529 std::string getDeviceType() const
531 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
532 for(auto child = children.begin(); child != children.end(); ++child)
534 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
536 OCRepresentation rep;
537 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
539 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
543 return std::string("");
546 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_DEVICE_TYPE))
548 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_DEVICE_TYPE);
552 return std::string("");
556 * Get a device sub-type of Enrollee.
557 * It is Device's human-friendly name like device model name.
559 * @return a device sub-type of Enrollee
561 std::string getDeviceSubType() const
563 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
564 for(auto child = children.begin(); child != children.end(); ++child)
566 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
568 OCRepresentation rep;
569 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
571 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
575 return std::string("");
578 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE))
580 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_DEVICE_SUBTYPE);
584 return std::string("");
588 * Get Set device information used for 'register TV'
589 * The format is in json. The key indicates the meaning of value and the value is a
590 * corresponding information. Supported keys include: wm(Wifi MAC), pm(P2P MAC),
591 * bm(BT MAC), rt(Remote Type)
593 * @return Register Set Device
595 std::string getRegisterSetDevice() const
597 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
598 for(auto child = children.begin(); child != children.end(); ++child)
600 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
602 OCRepresentation rep;
603 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
605 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
609 return std::string("");
612 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV))
614 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGISTER_SET_DEV);
618 return std::string("");
622 * Get network provisioning information for the device.
623 * Mediator can use this information to enquire & validate registration status with corresponding Network Vendor.
624 * The format is in JSON. The key indicates the meaning of value and the value is a
625 * corresponding information. Supported keys include: IMEI (IMEI Number), IMSI (IMSI Number),
626 * MCC_MNC(MCC & MNC Number), SN(Serial Number)
628 * @return Network Provisioning Information String.
630 std::string getNetworkProvisioningInfo() const
632 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
633 for(auto child = children.begin(); child != children.end(); ++child)
635 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
637 OCRepresentation rep;
638 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
640 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
644 return std::string("");
647 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO))
649 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_NETWORK_PROV_INFO);
653 return std::string("");
657 * Get SSO List information for the device.
658 * The format is in JSON. The key indicates the meaning of value and the value is a
659 * corresponding information. Supported keys include: Available Count , Registered Count,
662 * @return SSo List Information String.
664 std::string getSSOList() const
666 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
667 for(auto child = children.begin(); child != children.end(); ++child)
669 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
671 OCRepresentation rep;
672 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
674 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
678 return std::string("");
681 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_SSO_LIST))
683 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_SSO_LIST);
687 return std::string("");
692 * Indicates T&C is already agreed or not.
698 TC_STATUS getTCStatus()
700 OCRepresentation rep;
701 if(m_EasySetupRep.hasAttribute(OC_RSRVD_REPRESENTATION))
703 rep = m_EasySetupRep.getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
707 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
710 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_STATUS))
712 return static_cast<TC_STATUS>
713 (rep.getValue<int>(SC_RSRVD_ES_VENDOR_TC_STATUS));
716 return TC_STATUS::TC_STATUS_NOT_SUPPORTED;
721 * T&C Header Information in json format
725 std::string getTCHeader()
727 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
728 for(auto child = children.begin(); child != children.end(); ++child)
730 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
732 OCRepresentation rep;
733 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
735 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
739 return std::string("");
742 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_HEADER))
744 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_HEADER);
748 return std::string("");
754 * @return T&C Version
756 std::string getTCVersion()
758 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
759 for(auto child = children.begin(); child != children.end(); ++child)
761 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
763 OCRepresentation rep;
764 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
766 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
770 return std::string("");
773 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_TC_VERSION))
775 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_TC_VERSION);
779 return std::string("");
787 std::string getPnpPin() const
789 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
790 for(auto child = children.begin(); child != children.end(); ++child)
792 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
794 OCRepresentation rep;
795 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
797 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
801 return std::string("");
804 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_PNP_PIN))
806 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_PNP_PIN);
810 return std::string("");
814 * Get a network connection state property of Enrollee.
816 * @return a network connection state property of Enrollee.
818 NETCONNECTION_STATE getNetConnectionState() const
820 OCRepresentation rep;
821 if(m_EasySetupRep.hasAttribute(OC_RSRVD_REPRESENTATION))
823 rep = m_EasySetupRep.getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
827 return NETCONNECTION_STATE::NET_STATE_INIT;
830 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE))
832 return static_cast<NETCONNECTION_STATE>
833 (rep.getValue<int>(SC_RSRVD_ES_VENDOR_NETCONNECTION_STATE));
836 return NETCONNECTION_STATE::NET_STATE_INIT;
840 * Get a BSSID of Enroller
842 * @return a BSSID of enroller
844 std::string getBSSID() const
846 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
847 for(auto child = children.begin(); child != children.end(); ++child)
849 if(child->getUri().find(OC_RSRVD_ES_URI_WIFICONF) != std::string::npos)
851 OCRepresentation rep;
852 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
854 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
858 return std::string("");
861 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_BSSID))
863 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_BSSID);
873 * @return UTC date time
875 std::string getUTCDatetime() const
877 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
878 for(auto child = children.begin(); child != children.end(); ++child)
880 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
882 OCRepresentation rep;
883 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
885 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
889 return std::string("");
892 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME))
894 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_UTC_DATE_TIME);
902 * Get regional date time
906 std::string getRegionalDatetime() const
908 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
909 for(auto child = children.begin(); child != children.end(); ++child)
911 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
913 OCRepresentation rep;
914 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
916 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
920 return std::string("");
923 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME))
925 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_REGIONAL_DATE_TIME);
933 * Get Samsung Easy Setup Protocol Version.
935 * Mediator can use this API to differentiate between Easy Setup Protcol supported by
936 * Samsung Enrollee Devices.
938 * Example: Version Value for Tizen4.0: [
\932.0
\94]
940 * @return Easy Setup Protocol Version String.
942 std::string getESProtocolVersion() const
944 std::vector<OCRepresentation> children = m_EasySetupRep.getChildren();
945 for(auto child = children.begin(); child != children.end(); ++child)
947 if(child->getUri().find(OC_RSRVD_ES_URI_DEVCONF) != std::string::npos)
949 OCRepresentation rep;
950 if(child->hasAttribute(OC_RSRVD_REPRESENTATION))
952 rep = child->getValue<OCRepresentation>(OC_RSRVD_REPRESENTATION);
956 return std::string("");
959 if(rep.hasAttribute(SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION))
961 return rep.getValue<std::string>(SC_RSRVD_ES_VENDOR_ES_PROTOCOL_VERSION);
965 return std::string("");
972 #endif //ESSC_COMMON_RICH_H_