+ public:
+
+ /**
+ * Constructor
+ */
+ DeviceProp()
+ {
+ }
+
+ DeviceProp(const DeviceProp& deviceProp) :
+ m_rep(deviceProp.toOCRepresentation())
+ {
+ }
+
+ DeviceProp(const DeviceProp&& deviceProp) :
+ m_rep(std::move(deviceProp.toOCRepresentation()))
+ {
+ }
+
+ /**
+ * Constructor with OCRepresentation object. This is used for JNI communication.
+ */
+ DeviceProp(const OCRepresentation &rep)
+ {
+ m_rep = rep;
+ }
+
+ /**
+ * Set WiFiConf resource properties to be delivered to Enrollee
+ *
+ * @param ssid Ssid of the Enroller
+ * @param pwd Pwd of the Enrolle
+ * @param authtype Auth type of the Enroller
+ * @param enctype Encryption type of the Enroller
+ *
+ * @see WIFI_AUTHTYPE
+ * @see WIFI_ENCTYPE
+ */
+ void setWiFiProp(string ssid, string pwd, WIFI_AUTHTYPE authtype, WIFI_ENCTYPE enctype)
+ {
+ m_rep.setValue(OC_RSRVD_ES_SSID, ssid);
+ m_rep.setValue(OC_RSRVD_ES_CRED, pwd);
+ m_rep.setValue(OC_RSRVD_ES_AUTHTYPE, authtype);
+ m_rep.setValue(OC_RSRVD_ES_ENCTYPE, enctype);
+ }
+
+ /**
+ * Get a SSID of Enroller
+ *
+ * @return a SSID of enroller
+ */
+ std::string getSsid() const
+ {
+ if(m_rep.hasAttribute(OC_RSRVD_ES_SSID))
+ {
+ return m_rep.getValue<std::string>(OC_RSRVD_ES_SSID);
+ }
+ return std::string("");
+ }
+
+ /**
+ * Get a password of Enroller
+ *
+ * @return a password of enroller
+ */
+ std::string getPassword() const
+ {
+ if(m_rep.hasAttribute(OC_RSRVD_ES_CRED))
+ {
+ return m_rep.getValue<std::string>(OC_RSRVD_ES_CRED);
+ }
+ return std::string("");
+ }
+
+ /**
+ * Get an auth type of Enroller
+ *
+ * @return an auth type of enroller
+ *
+ * @see WIFI_AUTHTYPE
+ */
+ WIFI_AUTHTYPE getAuthType() const
+ {
+ if(m_rep.hasAttribute(OC_RSRVD_ES_AUTHTYPE))
+ {
+ return static_cast<WIFI_AUTHTYPE>(m_rep.getValue<int>(OC_RSRVD_ES_AUTHTYPE));
+ }
+ return NONE_AUTH;
+ }
+
+ /**
+ * Get an encryption type of Enroller
+ *
+ * @return an encryption type of enroller
+ *
+ * @see WIFI_ENCTYPE
+ */
+ WIFI_ENCTYPE getEncType() const
+ {
+ if(m_rep.hasAttribute(OC_RSRVD_ES_ENCTYPE))
+ {
+ return static_cast<WIFI_ENCTYPE>(m_rep.getValue<int>(OC_RSRVD_ES_ENCTYPE));
+ }
+ return NONE_ENC;
+ }
+
+ /**
+ * Get OCRepresentation object
+ *
+ * @return OCRepresentation object
+ */
+ const OCRepresentation &toOCRepresentation() const
+ {
+ return m_rep;
+ }
+
+ protected:
+ OCRepresentation m_rep;
+ };