-#define OIC_STRING_MAX_VALUE 64
+#define OIC_STRING_MAX_VALUE 256
#define MAX_WEBLINKLEN 3
-#define NUM_WIFIMODE 5
+#define NUM_WIFIMODE 10
+#define NUM_CONNECT_TYPE 3
/**
* Attributes used to form a proper easysetup conforming JSON message.
#define OC_RSRVD_ES_AUTHTYPE "wat"
#define OC_RSRVD_ES_ENCTYPE "wet"
#define OC_RSRVD_ES_AUTHCODE "ac"
+#define OC_RSRVD_ES_ACCESSTOKEN "at"
+#define OC_RSRVD_ES_ACCESSTOKEN_TYPE "att"
#define OC_RSRVD_ES_AUTHPROVIDER "apn"
#define OC_RSRVD_ES_CISERVER "cis"
#define OC_RSRVD_ES_SERVERID "sid"
#define OC_RSRVD_ES_DEVNAME "dn"
-#define OC_RSRVD_ES_LANGUAGE "lang"
-#define OC_RSRVD_ES_COUNTRY "ctry"
-#define OC_RSRVD_ES_MODELNUMBER "mnmo"
-#define OC_RSRVD_ES_LOCATION "loc"
#define OC_RSRVD_ES_HREF "href"
+#define OC_RSRVD_ES_CONNECT "cn"
/**
* Easysetup defined resoruce types and uris.
*/
-#define OC_RSRVD_ES_RES_TYPE_PROV "oic.wk.prov"
-#define OC_RSRVD_ES_URI_PROV "/ProvisioningResURI"
-#define OC_RSRVD_ES_RES_TYPE_WIFI "oic.wk.wifi"
-#define OC_RSRVD_ES_URI_WIFI "/WiFiProvisioningResURI"
-#define OC_RSRVD_ES_RES_TYPE_CLOUDSERVER "oic.wk.cloudserver"
-#define OC_RSRVD_ES_URI_CLOUDSERVER "/CloudServerProvisioningResURI"
-#define OC_RSRVD_ES_RES_TYPE_DEVCONF "oic.wk.devconf"
-#define OC_RSRVD_ES_URI_DEVCONF "/DevConfProvisioningResURI"
+#define OC_RSRVD_ES_RES_TYPE_EASYSETUP "oic.r.easysetup"
+#define OC_RSRVD_ES_URI_EASYSETUP "/EasySetupResURI"
+#define OC_RSRVD_ES_RES_TYPE_WIFICONF "oic.r.wificonf"
+#define OC_RSRVD_ES_URI_WIFICONF "/WiFiConfResURI"
+#define OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF "oic.r.coapcloudconf"
+#define OC_RSRVD_ES_URI_COAPCLOUDCONF "/CoapCloudConfResURI"
+#define OC_RSRVD_ES_RES_TYPE_DEVCONF "oic.r.devconf"
+#define OC_RSRVD_ES_URI_DEVCONF "/DevConfResURI"
/**
} WIFI_ENCTYPE;
/**
+ * @brief OAuth Access Token Types. "bearer" and "mac" types are supported.
+ */
+typedef enum
+{
+ NONE_OAUTH_TOKENTYPE = 0,
+ OAUTH_TOKENTYPE_BEARER,
+ OAUTH_TOKENTYPE_MAC
+} OAUTH_TOKENTYPE;
+
+/**
+ * @brief A target configuration type to be connected (or executed)
+ */
+typedef enum
+{
+ ES_CONNECT_NONE = 0, /**< Init value **/
+ ES_CONNECT_WIFI = 1, /**< WiFi Conf resource **/
+ ES_CONNECT_COAPCLOUD = 2 /**< Coap Cloud Conf resource **/
+} ES_CONNECT_TYPE;
+
+/**
* @brief A result of Easy Setup
*/
typedef enum
ES_OK = 0,
/**
+ * Secure resource is discovered.
+ */
+ ES_SECURE_RESOURCE_IS_DISCOVERED = 1,
+
+ /**
* Enrollee discovery fails in cloud provisioning
*/
ES_ENROLLEE_DISCOVERY_FAILURE = 11,
/**
* Security opertion is not supported because Mediator is built as unsecured mode.
*/
- ES_SEC_OPERATION_IS_NOT_SUPPORTED = 20,
+ ES_SEC_OPERATION_IS_NOT_SUPPORTED,
/**
* Security resource discovery fails due to loss of discovery packet or absence of the resource in a network
ES_SECURE_RESOURCE_DISCOVERY_FAILURE,
/**
- * Ownership transfer fails because DTLS handshake failure happens
+ * Ownership transfer fails due to one of unexpected reasons.
+ * E.g. A packet loss even with retransmission happens during ownership transfer.
+ * E.g. Mediator's owned status is 'unowned'
+ * E.g. A user confirmation for random pin-based or certificate-based OT fails
+ */
+ ES_OWNERSHIP_TRANSFER_FAILURE = 20,
+
+ /**
+ * Ownership transfer which is cert-based method fails due to user confirmation is denied.
*/
- ES_OWNERSHIP_TRANSFER_FAILURE,
+ ES_USER_DENIED_CONFIRMATION_REQ,
+
+ /**
+ * Ownership transfer which is cert-based method fails due to wrong certificate.
+ */
+ ES_AUTHENTICATION_FAILURE_WITH_WRONG_CERT,
+
+ /**
+ * Ownership transfer which is random-pin method fails due to wrong pin.
+ */
+ ES_AUTHENTICATION_FAILURE_WITH_WRONG_PIN,
+
+ /**
+ * Ownership information is not synchronized between Mediator and Enrollee.
+ * e.g. A mediator's PDM DB has an ownership information to the found enrollee
+ * but it is actually owned by other mediator.
+ * That can happen where the found enrollee is reset and performed in easy setup without any inform to the first mediator.
+ * e.g. A list of owned devices managed in mediator's PMD db has no element for the found enrollee.
+ * That can happen where only mediator is reset without any inform to the enrollee.
+ * To proceed an ownership transfer to the enrollee, it needs to reset the enrollee's SVR DB for its owner, i.e. the mediator
+ */
+ ES_OWNERSHIP_IS_NOT_SYNCHRONIZED,
+
+ /**
+ * MOT is not supported at the target Enrollee device.
+ *
+ * @note This ESResult values will be returned ONLY IF a mediator is a first owner to an Enrollee.
+ * @note If the mediator gets this values, it means OT has been successfully done
+ * (or already took an ownership, before), but failed MOT configuration.
+ */
+ ES_MOT_NOT_SUPPORTED = 30,
+
+ /**
+ * MOT enabling is failed.
+ *
+ * @note This ESResult values will be returned ONLY IF a mediator is a first owner to an Enrollee.
+ * @note If the mediator gets this values, it means OT has been successfully done
+ * (or already took an ownership, before), but failed MOT configuration.
+ */
+ ES_MOT_ENABLING_FAILURE,
+
+ /**
+ * MOT method selection is failed
+ *
+ * @note This ESResult values will be returned ONLY IF a mediator is a first owner to an Enrollee.
+ * @note If the mediator gets this values, it means OT has been successfully done
+ * (or already took an ownership, before), but failed MOT configuration.
+ */
+ ES_MOT_METHOD_SELECTION_FAILURE,
+
+ /**
+ * A provisioning of Pre-configured pin number for MOT is failed
+ *
+ * @note This ESResult values will be returned ONLY IF a mediator is a first owner to an Enrollee.
+ * @note If the mediator gets this values, it means OT has been successfully done
+ * (or already took an ownership, before), but failed MOT configuration.
+ */
+ ES_PRE_CONFIG_PIN_PROVISIONING_FAILURE,
/**
* ACL provisioning fails in cloud provisioning.
* It could be that UUID format of cloud server is wrong.
* Or any response for the provisioning request is not arrived at Mediator
*/
- ES_ACL_PROVISIONING_FAILURE,
+ ES_ACL_PROVISIONING_FAILURE = 40,
/**
* Cert. provisioning fails in cloud provisioning.
/**
* Provisioning fails for some reason.
*/
+
ES_ERROR = 255
} ESResult;
*/
typedef enum
{
- ES_WIFI_RESOURCE = 0x01,
- ES_CLOUD_RESOURCE = 0x02,
+ ES_WIFICONF_RESOURCE = 0x01,
+ ES_COAPCLOUDCONF_RESOURCE = 0x02,
ES_DEVCONF_RESOURCE = 0x04
} ESResourceMask;
/**
* @brief Indicate enrollee and provisioning status. Provisioning status is shown in "provisioning
- * status" property in provisioning resource.
+ * status" property in easysetup resource.
*/
typedef enum
{
ES_ERRCODE_FAILED_TO_FIND_REGISTERED_USER_IN_CLOUD,
/**
+ * Error Code that an enrollee can not connect to a target WiFi AP because the AP resides in
+ * an unsupported WiFi frequency.
+ */
+ ES_ERRCODE_UNSUPPORTED_WIFI_FREQUENCY,
+
+ /**
* Error Code that Unknown error occured
*/
ES_ERRCODE_UNKNOWN = 255