Commit bff73296 authored by Jihun Ha's avatar Jihun Ha Committed by Uze Choi

Change resource type, URI, and all relevant words in Easy setup service

On decision of OCF meeting, resource types and URIs of easy setup resources
are decided to be changed:
* Resource type
  oic.wk.prov -> oic.r.easysetup
  oic.wk.wifi -> oic.r.wificonf
  oic.wk.cloudserver -> oic.r.coapcloudconf
  oic.wk.devconf -> oic.r.devconf
* URI
  /ProvisioningResURI -> /EasySetupResURI
  /WiFiProvisioningResURI -> /WiFiConfResURI
  /CloudServerProvisioningResURI -> /CoapCloudConfResURI
  /DevConfProvisioningResURI -> /DevConfResURI

Along with those changes, all classes, functions, structures' names are
changed, respectively.

Change-Id: I45a34e69be3348dd5adb9f7478995bee53be80e5
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16581Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarUze Choi <uzchoi@samsung.com>
parent cbee1583
......@@ -34,12 +34,12 @@ extern "C"
*/
typedef struct
{
char ssid[OIC_STRING_MAX_VALUE]; /**< Ssid of the Enroller**/
char pwd[OIC_STRING_MAX_VALUE]; /**< Pwd of the Enroller**/
WIFI_AUTHTYPE authtype; /**< Auth type of the Enroller**/
WIFI_ENCTYPE enctype; /**< Encryption type of the Enroller**/
void *userdata; /**< Vender-specific data**/
} ESWiFiProvData;
char ssid[OIC_STRING_MAX_VALUE]; /**< Ssid of the Enroller**/
char pwd[OIC_STRING_MAX_VALUE]; /**< Pwd of the Enroller**/
WIFI_AUTHTYPE authtype; /**< Auth type of the Enroller**/
WIFI_ENCTYPE enctype; /**< Encryption type of the Enroller**/
void *userdata; /**< Vender-specific data**/
} ESWiFiConfData;
/**
* @brief Data structure delivered from mediator, which provides device configuration information
......@@ -50,7 +50,7 @@ typedef struct
char language[OIC_STRING_MAX_VALUE]; /**< IETF language tag using ISO 639X **/
char country[OIC_STRING_MAX_VALUE]; /**< ISO Country Code (ISO 3166-1 Alpha-2) **/
void *userdata; /**< Vender-specific data**/
} ESDevConfProvData;
} ESDevConfData;
/**
* @brief Data structure delivered from mediator, which provides Cloud server information
......@@ -63,7 +63,7 @@ typedef struct
char authProvider[OIC_STRING_MAX_VALUE]; /**< Auth provider ID **/
char ciServer[OIC_STRING_MAX_VALUE]; /**< Cloud interface server URL which an Enrollee is going to registered **/
void *userdata; /**< Vender-specific data**/
} ESCloudProvData;
} ESCoapCloudConfData;
/**
* @brief Data structure stored for Device property which includes a WiFi and device configuration.
......@@ -95,9 +95,9 @@ typedef struct
*/
typedef struct
{
void (*WiFiProvCb) (ESWiFiProvData *);
void (*DevConfProvCb) (ESDevConfProvData *);
void (*CloudDataProvCb) (ESCloudProvData *);
void (*WiFiConfProvCb) (ESWiFiConfData *);
void (*DevConfProvCb) (ESDevConfData *);
void (*CoapCloudConfProvCb) (ESCoapCloudConfData *);
} ESProvisioningCallbacks;
......
......@@ -61,10 +61,10 @@ typedef void (*ESReadUserdataCb)(OCRepPayload* payload, char* resourceType, void
*
* @param isSecured True if the Enrollee is operating in secured mode.
* @param resourceMask Provisining Resource Type which application wants to make.
* ES_WIFI_RESOURCE = 0x01,
* ES_CLOUD_RESOURCE = 0x02,
* ES_WIFICONF_RESOURCE = 0x01,
* ES_COAPCLOUDCONF_RESOURCE = 0x02,
* ES_DEVCONF_RESOURCE = 0x04
* @param callbacks ESProvisioningCallbacks for updating Provisioning Resources' data to the application
* @param callbacks ESProvisioningCallbacks for updating Easy setup Resources' data to the application
* @return ::ES_OK on success, some other value upon failure.
*/
ESResult ESInitEnrollee(bool isSecured, ESResourceMask resourceMask, ESProvisioningCallbacks callbacks);
......@@ -73,7 +73,7 @@ ESResult ESInitEnrollee(bool isSecured, ESResourceMask resourceMask, ESProvision
/**
* This function Sets Device Information.
*
* @param deviceProperty Contains device information composed of WiFi Structure & DevConf Structure
* @param deviceProperty Contains device information composed of WiFiConf Structure & DevConf Structure
* @return ::ES_OK on success, some other value upon failure.
*
* @see ESDeviceProperty
......@@ -103,8 +103,7 @@ ESResult ESSetState(ESEnrolleeState esState);
ESResult ESSetErrorCode(ESErrorCode esErrCode);
/**
* This function performs termination of Provisioning and Network resources.
* Also terminates the IoTivity core stack.
* This function performs termination of all Easy setup resources.
*
* @return ::ES_OK on success, some other value upon failure.
*/
......
......@@ -44,56 +44,56 @@ static bool gIsSecured = false;
static ESProvisioningCallbacks gESProvisioningCb;
static ESDeviceProperty gESDeviceProperty;
void ESWiFiRsrcCallback(ESResult esResult, ESWiFiProvData *eventData)
void ESWiFiConfRsrcCallback(ESResult esResult, ESWiFiConfData *eventData)
{
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESWiFiRsrcCallback IN");
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback IN");
if(esResult != ES_OK)
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESWiFiRsrcCallback Error Occured");
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback Error Occured");
return;
}
// deliver data to ESProvisioningCallbacks
if(gESProvisioningCb.WiFiProvCb != NULL)
if(gESProvisioningCb.WiFiConfProvCb != NULL)
{
gESProvisioningCb.WiFiProvCb(eventData);
gESProvisioningCb.WiFiConfProvCb(eventData);
}
else
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "WiFiProvCb is NULL");
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "WiFiConfProvCb is NULL");
return;
}
}
void ESCloudRsrcCallback(ESResult esResult, ESCloudProvData *eventData)
void ESCoapCloudConfRsrcCallback(ESResult esResult, ESCoapCloudConfData *eventData)
{
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESCloudRsrcCallback IN");
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback IN");
if(esResult != ES_OK)
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESCloudRsrcCallback Error Occured");
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback Error Occured");
return;
}
if(gESProvisioningCb.CloudDataProvCb != NULL)
if(gESProvisioningCb.CoapCloudConfProvCb != NULL)
{
gESProvisioningCb.CloudDataProvCb(eventData);
gESProvisioningCb.CoapCloudConfProvCb(eventData);
}
else
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "CloudDataProvCb is NULL");
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "CoapCloudConfProvCb is NULL");
return;
}
}
void ESDevconfRsrcallback(ESResult esResult, ESDevConfProvData *eventData)
void ESDevConfRsrcallback(ESResult esResult, ESDevConfData *eventData)
{
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESDevconfRsrcallback IN");
OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESDevConfRsrcallback IN");
if(esResult != ES_OK)
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESDevconfRsrcallback Error Occured");
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESDevConfRsrcallback Error Occured");
return;
}
......@@ -114,16 +114,16 @@ ESResult ESInitEnrollee(bool isSecured, ESResourceMask resourceMask, ESProvision
gIsSecured = isSecured;
if((resourceMask & ES_WIFI_RESOURCE) == ES_WIFI_RESOURCE)
if((resourceMask & ES_WIFICONF_RESOURCE) == ES_WIFICONF_RESOURCE)
{
if(callbacks.WiFiProvCb != NULL)
if(callbacks.WiFiConfProvCb != NULL)
{
gESProvisioningCb.WiFiProvCb = callbacks.WiFiProvCb;
RegisterWifiRsrcEventCallBack(ESWiFiRsrcCallback);
gESProvisioningCb.WiFiConfProvCb = callbacks.WiFiConfProvCb;
RegisterWifiRsrcEventCallBack(ESWiFiConfRsrcCallback);
}
else
{
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "WiFiProvCb NULL");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "WiFiConfProvCb NULL");
return ES_ERROR;
}
}
......@@ -132,7 +132,7 @@ ESResult ESInitEnrollee(bool isSecured, ESResourceMask resourceMask, ESProvision
if(callbacks.DevConfProvCb != NULL)
{
gESProvisioningCb.DevConfProvCb = callbacks.DevConfProvCb;
RegisterDevConfRsrcEventCallBack(ESDevconfRsrcallback);
RegisterDevConfRsrcEventCallBack(ESDevConfRsrcallback);
}
else
{
......@@ -140,16 +140,16 @@ ESResult ESInitEnrollee(bool isSecured, ESResourceMask resourceMask, ESProvision
return ES_ERROR;
}
}
if((resourceMask & ES_CLOUD_RESOURCE) == ES_CLOUD_RESOURCE)
if((resourceMask & ES_COAPCLOUDCONF_RESOURCE) == ES_COAPCLOUDCONF_RESOURCE)
{
if(callbacks.CloudDataProvCb != NULL)
if(callbacks.CoapCloudConfProvCb != NULL)
{
gESProvisioningCb.CloudDataProvCb = callbacks.CloudDataProvCb;
RegisterCloudRsrcEventCallBack(ESCloudRsrcCallback);
gESProvisioningCb.CoapCloudConfProvCb = callbacks.CoapCloudConfProvCb;
RegisterCloudRsrcEventCallBack(ESCoapCloudConfRsrcCallback);
}
else
{
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "CloudDataProvCb NULL");
OIC_LOG(ERROR, ES_ENROLLEE_TAG, "CoapCloudConfProvCb NULL");
return ES_ERROR;
}
}
......
......@@ -34,20 +34,20 @@
extern "C" {
#endif
typedef void (*ESWiFiCB) (ESResult, ESWiFiProvData *);
typedef void (*ESCloudCB) (ESResult, ESCloudProvData *);
typedef void (*ESDevConfCB) (ESResult, ESDevConfProvData *);
typedef void (*ESWiFiConfCB) (ESResult, ESWiFiConfData *);
typedef void (*ESCoapCloudConfCB) (ESResult, ESCoapCloudConfData *);
typedef void (*ESDevConfCB) (ESResult, ESDevConfData *);
typedef void (*ESWriteUserdataCb)(OCRepPayload* payload, char* resourceType);
typedef void (*ESReadUserdataCb)(OCRepPayload* payload, char* resourceType, void** userdata);
/* Structure to represent a Light resource */
typedef struct PROVRESOURCE
typedef struct
{
OCResourceHandle handle;
ProvStatus status; // provisiong status
ESErrorCode lastErrCode;
} ProvResource;
} EasySetupResource;
typedef struct
{
......@@ -59,7 +59,7 @@ typedef struct
char cred[OIC_STRING_MAX_VALUE]; // credential information.
WIFI_AUTHTYPE authType;
WIFI_ENCTYPE encType;
} WiFiResource;
} WiFiConfResource;
typedef struct
{
......@@ -69,7 +69,7 @@ typedef struct
OAUTH_TOKENTYPE accessTokenType;
char authProvider[OIC_STRING_MAX_VALUE];
char ciServer[OIC_STRING_MAX_VALUE];
} CloudResource;
} CoapCloudConfResource;
typedef struct
{
......@@ -82,9 +82,9 @@ typedef struct
} DevConfResource;
/* Note: These values of structures are not thread-safety */
extern ProvResource g_ESProvResource;
extern WiFiResource g_ESWiFiResource;
extern CloudResource g_ESCloudResource;
extern EasySetupResource g_ESEasySetupResource;
extern WiFiConfResource g_ESWiFiConfResource;
extern CoapCloudConfResource g_ESCoapCloudConfResource;
extern DevConfResource g_ESDevConfResource;
OCStackResult CreateEasySetupResources(bool isSecured, ESResourceMask resourceMask);
......@@ -95,8 +95,8 @@ OCStackResult SetEnrolleeState(ESEnrolleeState esState);
OCStackResult SetEnrolleeErrCode(ESErrorCode esErrCode);
OCEntityHandlerResult CheckEhRequestPayload(OCEntityHandlerRequest *ehRequest);
void RegisterWifiRsrcEventCallBack(ESWiFiCB);
void RegisterCloudRsrcEventCallBack(ESCloudCB);
void RegisterWifiRsrcEventCallBack(ESWiFiConfCB);
void RegisterCloudRsrcEventCallBack(ESCoapCloudConfCB);
void RegisterDevConfRsrcEventCallBack(ESDevConfCB);
void UnRegisterResourceEventCallBack(void);
ESResult SetCallbackForUserData(ESReadUserdataCb readCb, ESWriteUserdataCb writeCb);
......
......@@ -118,30 +118,30 @@ public:
std::cout << __func__ << std::endl;
}
static void WiFiProvCbInApp(ESWiFiProvData *)
static void WiFiConfProvCbInApp(ESWiFiConfData *)
{
std::cout << __func__ << std::endl;
}
static void DevConfProvCbInApp(ESDevConfProvData *)
static void DevConfProvCbInApp(ESDevConfData *)
{
std::cout << __func__ << std::endl;
}
static void CloudDataCbInApp(ESCloudProvData *)
static void CoapCloudConfCbInApp(ESCoapCloudConfData *)
{
std::cout << __func__ << std::endl;
}
ESResult startEnrollee()
{
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFI_RESOURCE |
ES_CLOUD_RESOURCE |
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFICONF_RESOURCE |
ES_COAPCLOUDCONF_RESOURCE |
ES_DEVCONF_RESOURCE);
ESProvisioningCallbacks callbacks;
callbacks.WiFiProvCb = &EasysetupEnrolleeTest::WiFiProvCbInApp;
callbacks.WiFiConfProvCb = &EasysetupEnrolleeTest::WiFiConfProvCbInApp;
callbacks.DevConfProvCb = &EasysetupEnrolleeTest::DevConfProvCbInApp;
callbacks.CloudDataProvCb = &EasysetupEnrolleeTest::CloudDataCbInApp;
callbacks.CoapCloudConfProvCb = &EasysetupEnrolleeTest::CoapCloudConfCbInApp;
return ESInitEnrollee(false, resourcemMask, callbacks);
}
......@@ -149,9 +149,9 @@ public:
ESResult startEnrolleeWithInvalidRsrcMask()
{
ESProvisioningCallbacks callbacks;
callbacks.WiFiProvCb = &EasysetupEnrolleeTest::WiFiProvCbInApp;
callbacks.WiFiConfProvCb = &EasysetupEnrolleeTest::WiFiConfProvCbInApp;
callbacks.DevConfProvCb = &EasysetupEnrolleeTest::DevConfProvCbInApp;
callbacks.CloudDataProvCb = &EasysetupEnrolleeTest::CloudDataCbInApp;
callbacks.CoapCloudConfProvCb = &EasysetupEnrolleeTest::CoapCloudConfCbInApp;
return ESInitEnrollee(false, (ESResourceMask)0, callbacks);
}
......@@ -211,13 +211,13 @@ TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedInvalidRsrcMask)
TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedByWiFiCbIsNull)
{
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFI_RESOURCE |
ES_CLOUD_RESOURCE |
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFICONF_RESOURCE |
ES_COAPCLOUDCONF_RESOURCE |
ES_DEVCONF_RESOURCE);
ESProvisioningCallbacks callbacks;
callbacks.WiFiProvCb = NULL;
callbacks.WiFiConfProvCb = NULL;
callbacks.DevConfProvCb = &EasysetupEnrolleeTest::DevConfProvCbInApp;
callbacks.CloudDataProvCb = &EasysetupEnrolleeTest::CloudDataCbInApp;
callbacks.CoapCloudConfProvCb = &EasysetupEnrolleeTest::CoapCloudConfCbInApp;
ESResult ret = ESInitEnrollee(false, resourcemMask, callbacks);
EXPECT_EQ(ret, ES_ERROR);
......@@ -226,13 +226,13 @@ TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedByWiFiCbIsNull)
TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedByDevConfCbIsNull)
{
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFI_RESOURCE |
ES_CLOUD_RESOURCE |
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFICONF_RESOURCE |
ES_COAPCLOUDCONF_RESOURCE |
ES_DEVCONF_RESOURCE);
ESProvisioningCallbacks callbacks;
callbacks.WiFiProvCb = &EasysetupEnrolleeTest::WiFiProvCbInApp;
callbacks.WiFiConfProvCb = &EasysetupEnrolleeTest::WiFiConfProvCbInApp;
callbacks.DevConfProvCb = NULL;
callbacks.CloudDataProvCb = &EasysetupEnrolleeTest::CloudDataCbInApp;
callbacks.CoapCloudConfProvCb = &EasysetupEnrolleeTest::CoapCloudConfCbInApp;
ESResult ret = ESInitEnrollee(false, resourcemMask, callbacks);
EXPECT_EQ(ret, ES_ERROR);
......@@ -241,13 +241,13 @@ TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedByDevConfCbIsNull)
TEST_F(EasysetupEnrolleeTest, ESInitEnrolleeFailedByCloudCbIsNull)
{
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFI_RESOURCE |
ES_CLOUD_RESOURCE |
ESResourceMask resourcemMask = (ESResourceMask)(ES_WIFICONF_RESOURCE |
ES_COAPCLOUDCONF_RESOURCE |
ES_DEVCONF_RESOURCE);
ESProvisioningCallbacks callbacks;
callbacks.WiFiProvCb = &EasysetupEnrolleeTest::WiFiProvCbInApp;
callbacks.WiFiConfProvCb = &EasysetupEnrolleeTest::WiFiConfProvCbInApp;
callbacks.DevConfProvCb = &EasysetupEnrolleeTest::DevConfProvCbInApp;
callbacks.CloudDataProvCb = NULL;
callbacks.CoapCloudConfProvCb = NULL;
ESResult ret = ESInitEnrollee(false, resourcemMask, callbacks);
EXPECT_EQ(ret, ES_ERROR);
......@@ -382,8 +382,8 @@ TEST_F(EasysetupEnrolleeTest, WiFiAndDevConfProperiesProvisionedWithSuccess)
cntForReceivedCallbackWithSuccess++;
});
mocks.OnCallFunc(WiFiProvCbInApp).Do(
[& cntForReceivedCallbackWithSuccess](ESWiFiProvData *data)
mocks.OnCallFunc(WiFiConfProvCbInApp).Do(
[& cntForReceivedCallbackWithSuccess](ESWiFiConfData *data)
{
if(!strcmp(data->ssid, "Iotivity_SSID") &&
!strcmp(data->pwd, "Iotivity_PWD") &&
......@@ -394,7 +394,7 @@ TEST_F(EasysetupEnrolleeTest, WiFiAndDevConfProperiesProvisionedWithSuccess)
}
});
mocks.OnCallFunc(DevConfProvCbInApp).Do(
[& cntForReceivedCallbackWithSuccess](ESDevConfProvData *data)
[& cntForReceivedCallbackWithSuccess](ESDevConfData *data)
{
if(!strcmp(data->language, "korean") &&
!strcmp(data->country, "Korea"))
......@@ -428,8 +428,8 @@ TEST_F(EasysetupEnrolleeTest, CloudServerProperiesProvisionedWithSuccess)
}
});
mocks.OnCallFunc(CloudDataCbInApp).Do(
[& cntForReceivedCallbackWithSuccess](ESCloudProvData *data)
mocks.OnCallFunc(CoapCloudConfCbInApp).Do(
[& cntForReceivedCallbackWithSuccess](ESCoapCloudConfData *data)
{
if(!strcmp(data->authCode, "authCode") &&
!strcmp(data->authProvider, "authProvider") &&
......
......@@ -68,7 +68,7 @@ public:
void discoverRemoteEnrollee(std::function<void(std::shared_ptr<OC::OCResource> resource)> cb)
{
m_discoveryCb = cb;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCb,
......@@ -80,7 +80,7 @@ public:
{
m_getConfigurationCb = cb;
m_remoteEnrollee = NULL;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToGetConfiguration,
......@@ -90,7 +90,7 @@ public:
void getWifiRsrc(std::function<void(const OCRepresentation& rep)> cb)
{
m_getWifiCb = cb;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_WIFI;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_WIFICONF;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToGetWifiRsrc,
......@@ -100,7 +100,7 @@ public:
void getCloudRsrc(std::function<void(const OCRepresentation& rep)> cb)
{
m_getCloudCb = cb;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_CLOUDSERVER;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToGetCloudRsrc,
......@@ -121,7 +121,7 @@ public:
{
m_getStatusCb = cb;
m_remoteEnrollee = NULL;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToGetStatus,
......@@ -132,7 +132,7 @@ public:
{
m_DevicePropProvisioningCb = cb;
m_remoteEnrollee = NULL;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToProvisionDeviceProperties,
......@@ -143,7 +143,7 @@ public:
{
m_CloudPropProvisioningCb = cb;
m_remoteEnrollee = NULL;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToProvisionCloudProperties,
......@@ -154,7 +154,7 @@ public:
{
m_provPutCb = cb;
m_remoteEnrollee = NULL;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_PROV;
std::string uri = std::string("/oic/res?rt=") + OC_RSRVD_ES_RES_TYPE_EASYSETUP;
OC::OCPlatform::findResource("", uri,
OCConnectivityType::CT_DEFAULT,
std::bind(&ESMediatorSimulator::discoverRemoteEnrolleeCbToPutProvRsrc,
......@@ -201,7 +201,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_PROV) && m_discoveryCb)
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_EASYSETUP) && m_discoveryCb)
{
m_discoveryCb(resource);
m_discoveryCb = NULL;
......@@ -224,7 +224,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_PROV) && m_getConfigurationCb
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_EASYSETUP) && m_getConfigurationCb
&& !m_remoteEnrollee)
{
m_remoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(resource);
......@@ -271,7 +271,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_WIFI) && m_getWifiCb)
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_WIFICONF) && m_getWifiCb)
{
QueryParamsMap test;
resource->get(test, std::bind(
......@@ -314,7 +314,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_CLOUDSERVER) && m_getCloudCb)
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF) && m_getCloudCb)
{
QueryParamsMap test;
resource->get(test, std::bind(
......@@ -381,7 +381,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_PROV) && m_getStatusCb
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_EASYSETUP) && m_getStatusCb
&& !m_remoteEnrollee)
{
m_remoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(resource);
......@@ -411,7 +411,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_PROV) &&
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_EASYSETUP) &&
m_DevicePropProvisioningCb && !m_remoteEnrollee)
{
m_remoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(resource);
......@@ -449,7 +449,7 @@ private:
return ;
}
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_PROV) &&
if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_EASYSETUP) &&
m_CloudPropProvisioningCb && !m_remoteEnrollee)
{
m_remoteEnrollee = EasySetup::getInstance()->createRemoteEnrollee(resource);
......
......@@ -68,14 +68,14 @@ extern "C"
/**
* 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"
/**
......@@ -239,14 +239,14 @@ typedef enum
*/
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
{
......
......@@ -48,13 +48,13 @@ public class ESConstants {
/**
* Easysetup defined resoruce types and uris
*/
public static final String OC_RSRVD_ES_RES_TYPE_PROV = "oic.wk.prov";
public static final String OC_RSRVD_ES_URI_PROV = "/ProvisioningResURI";
public static final String OC_RSRVD_ES_RES_TYPE_WIFI = "oic.wk.wifi";
public static final String OC_RSRVD_ES_URI_WIFI = "/WiFiProvisioningResURI";
public static final String OC_RSRVD_ES_RES_TYPE_CLOUDSERVER = "oic.wk.cloudserver";
public static final String OC_RSRVD_ES_URI_CLOUDSERVER = "/CloudServerProvisioningResURI";
public static final String OC_RSRVD_ES_RES_TYPE_DEVCONF = "oic.wk.devconf";
public static final String OC_RSRVD_ES_URI_DEVCONF = "/DevConfProvisioningResURI";
public static final String OC_RSRVD_ES_RES_TYPE_EASYSETUP = "oic.r.easysetup";
public static final String OC_RSRVD_ES_URI_EASYSETUP = "/EasySetupResURI";
public static final String OC_RSRVD_ES_RES_TYPE_WIFICONF = "oic.r.wificonf";
public static final String OC_RSRVD_ES_URI_WIFICONF = "/WiFiConfResURI";
public static final String OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF = "oic.r.coapcloudconf";
public static final String OC_RSRVD_ES_URI_COAPCLOUDCONF = "/CoapCloudConfResURI";
public static final String OC_RSRVD_ES_RES_TYPE_DEVCONF = "oic.r.devconf";
public static final String OC_RSRVD_ES_URI_DEVCONF = "/DevConfResURI";
}
......@@ -89,7 +89,7 @@ public class EasySetup {
* discovered in a network. The OcResource object can be obtained by calling
* OcPlatform.findResource() API. What resource you have to discover with
* the OcPlatform.findResource() API is a "provisioning" resource with a certain
* resource type, i.e. oic.wk.prov