Commit 6b0f3e09 authored by Jihun Ha's avatar Jihun Ha Committed by Madan Lanka

Add more provisioning status and error code in provisioning resource

To describe more specific provisioning status and error in easy setup,
some status and error codes are added.

Change-Id: Ibd37d207b55d6d6274380d2fd9aff0771c7c9911
Signed-off-by: default avatarJihun Ha <jihun.ha@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12641Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarHeewon Park <h_w.park@samsung.com>
Reviewed-by: default avatarMadan Lanka <lanka.madan@samsung.com>
parent 15faca00
......@@ -202,7 +202,7 @@ ESResult ESSetState(ESEnrolleeState esState)
{
OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESSetState IN");
if(esState < ES_STATE_INIT || esState > ES_STATE_REGISTRRED_FAIL_TO_CLOUD)
if(esState < ES_STATE_INIT || esState > ES_STATE_FAILED_TO_REGISTER_TO_CLOUD)
{
OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "Invalid ESEnrolleeState : %d", esState);
return ES_ERROR;
......
......@@ -197,29 +197,54 @@ typedef enum
ES_STATE_INIT = 0,
/**
* Status indicating being cnnecting to target network
*/
* Status indicating being connecting to target network
*/
ES_STATE_CONNECTING_TO_ENROLLER,
/**
* Status indicating successful conection to target network
*/
* Status indicating successful conection to target network
*/
ES_STATE_CONNECTED_TO_ENROLLER,
/**
* Status indicating failure connection to target network
*/
ES_STATE_CONNECTED_FAIL_TO_ENROLLER,
* Status indicating connection failure to target network
*/
ES_STATE_FAILED_TO_CONNECT_TO_ENROLLER,
/**
* Status indicating being registering to cloud
*/
ES_STATE_REGISTERING_TO_CLOUD,
/**
* Status indicating successful registration to cloud
*/
* Status indicating successful registration to cloud
*/
ES_STATE_REGISTERED_TO_CLOUD,
/**
* Status indicating failure registeration to cloud
*/
ES_STATE_REGISTRRED_FAIL_TO_CLOUD
* Status indicating registeration failure to cloud
*/
ES_STATE_FAILED_TO_REGISTER_TO_CLOUD,
/**
* Status indicating being publishing resources to cloud
*/
ES_STATE_PUBLISHING_RESOURCES_TO_CLOUD,
/**
* Status indicating successful resource publish to cloud
*/
ES_STATE_PUBLISHED_RESOURCES_TO_CLOUD,
/**
* Status indicating resource publish failure to cloud
*/
ES_STATE_FAILED_TO_PUBLISH_RESOURCES_TO_CLOUD,
/**
* End of Easy setup status
*/
ES_STATE_EOF = 255
} ESEnrolleeState, ProvStatus;
/**
......@@ -233,34 +258,69 @@ typedef enum
ES_ERRCODE_NO_ERROR = 0,
/**
* Error Code that given WiFi's SSID is not found
*/
* Error Code that given WiFi's SSID is not found
*/
ES_ERRCODE_SSID_NOT_FOUND,
/**
* Error Code that given WiFi's Password is wrong
*/
* Error Code that given WiFi's Password is wrong
*/
ES_ERRCODE_PW_WRONG,
/**
* Error Code that IP address is not allocated
*/
* Error Code that IP address is not allocated
*/
ES_ERRCODE_IP_NOT_ALLOCATED,
/**
* Error Code that there is no Internet connection
*/
* Error Code that there is no Internet connection
*/
ES_ERRCODE_NO_INTERNETCONNECTION,
/**
* Error Code that Timeout occured
*/
* Error Code that Timeout occured
*/
ES_ERRCODE_TIMEOUT,
/**
* Error Code that Unknown error occured
*/
ES_ERRCODE_UNKNOWN
* Error Code that cloud server is not reachable due to wrong URL of cloud server, for example.
*/
ES_ERRCODE_FAILED_TO_ACCESS_CLOUD_SERVER,
/**
* Error Code that no response is arrived from cloud server
*/
ES_ERRCODE_NO_RESPONSE_FROM_CLOUD_SERVER,
/**
* Error Code that a delivered authcode is not valid.
*/
ES_ERRCODE_INVALID_AUTHCODE,
/**
* Error Code that a given access token is not valid due to its expiration, for example.
*/
ES_ERRCODE_INVALID_ACCESSTOKEN,
/**
* Error Code that a refresh of expired access token is failed due to some reasons.
*/
ES_ERRCODE_FAILED_TO_REFRESH_ACCESSTOKEN,
/**
* Error Code that a target device is not discovered in cloud server
*/
ES_ERRCODE_FAILED_TO_FIND_REGISTERED_DEVICE_IN_CLOUD,
/**
* Error Code that a target user does not exist in cloud server.
*/
ES_ERRCODE_FAILED_TO_FIND_REGISTERED_USER_IN_CLOUD,
/**
* Error Code that Unknown error occured
*/
ES_ERRCODE_UNKNOWN = 255
} ESErrorCode;
#ifdef __cplusplus
......
......@@ -55,10 +55,45 @@ public enum ESErrorCode {
*/
ES_ERRCODE_TIMEOUT(5),
/**
* Error Code that cloud server is not reachable due to wrong URL of cloud server, for example.
*/
ES_ERRCODE_FAILED_TO_ACCESS_CLOUD_SERVER(6),
/**
* Error Code that no response is arrived from cloud server
*/
ES_ERRCODE_NO_RESPONSE_FROM_CLOUD_SERVER(7),
/**
* Error Code that a delivered authcode is not valid.
*/
ES_ERRCODE_INVALID_AUTHCODE(8),
/**
* Error Code that a given access token is not valid due to its expiration, for example.
*/
ES_ERRCODE_INVALID_ACCESSTOKEN(9),
/**
* Error Code that a refresh of expired access token is failed due to some reasons.
*/
ES_ERRCODE_FAILED_TO_REFRESH_ACCESSTOKEN(10),
/**
* Error Code that a target device is not discovered in cloud server
*/
ES_ERRCODE_FAILED_TO_FIND_REGISTERED_DEVICE_IN_CLOUD(11),
/**
* Error Code that a target user does not exist in cloud server.
*/
ES_ERRCODE_FAILED_TO_FIND_REGISTERED_USER_IN_CLOUD(12),
/**
* Error Code that Unknown error occured
*/
ES_ERRCODE_UNKNOWN(6);
ES_ERRCODE_UNKNOWN(255);
private int value;
......
......@@ -43,17 +43,42 @@ public enum ProvStatus {
/**
* Status indicating failure connection to target network
*/
ES_STATE_CONNECTED_FAIL_TO_ENROLLER(3),
ES_STATE_FAILED_TO_CONNECT_TO_ENROLLER(3),
/**
* Status indicating being registering to cloud
*/
ES_STATE_REGISTERING_TO_CLOUD(4),
/**
* Status indicating successful registration to cloud
*/
ES_STATE_REGISTERED_TO_CLOUD(4),
ES_STATE_REGISTERED_TO_CLOUD(5),
/**
* Status indicating registeration failure to cloud
*/
ES_STATE_FAILED_TO_REGISTER_TO_CLOUD(6),
/**
* Status indicating being publishing resources to cloud
*/
ES_STATE_PUBLISHING_RESOURCES_TO_CLOUD(7),
/**
* Status indicating successful resource publish to cloud
*/
ES_STATE_PUBLISHED_RESOURCES_TO_CLOUD(8),
/**
* Status indicating resource publish failure to cloud
*/
ES_STATE_FAILED_TO_PUBLISH_RESOURCES_TO_CLOUD(9),
/**
* Status indicating failure registration to cloud
* End of Easy setup status
*/
ES_STATE_REGISTRRED_FAIL_TO_CLOUD(5);
ES_STATE_EOF(255);
private int value;
......
......@@ -266,7 +266,7 @@ void ConnectToTargetAP()
WiFiConnErrCode ret = WIFI_NO_ERROR;
ret = TizenWiFiScanStart();
if(ret != WIFI_NO_ERROR){
ESSetState(ES_STATE_CONNECTED_FAIL_TO_ENROLLER);
ESSetState(ES_STATE_FAILED_TO_CONNECT_TO_ENROLLER);
ESSetErrorCode(ES_ERRCODE_UNKNOWN);
cout << "WiFi Scan Error" << endl;
return;
......@@ -277,7 +277,7 @@ void ConnectToTargetAP()
ret = TizenWiFiConn(gSSID, gPasswd);
if(ret != WIFI_NO_ERROR) {
ESSetState(ES_STATE_CONNECTED_FAIL_TO_ENROLLER);
ESSetState(ES_STATE_FAILED_TO_CONNECT_TO_ENROLLER);
if(ret == WIFI_NOTFOUND_SSID_ERROR) {
ESSetErrorCode(ES_ERRCODE_SSID_NOT_FOUND);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment