- VALID, CHANGED, CONTENT value is added.
- sample app also updated.
Change-Id: I41a59a3659bf27eb1de368ca3404e5bd101c2ed1
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1282
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
CA_SUCCESS = 200, /**< Success */
CA_CREATED = 201, /**< Created */
CA_DELETED = 202, /**< Deleted */
+ CA_VALID = 203, /**< Valid */
+ CA_CHANGED = 204, /**< Changed */
+ CA_CONTENT = 205, /**< Content */
CA_BAD_REQ = 400, /**< Bad Request */
CA_UNAUTHORIZED_REQ = 401, /**< Unauthorized Request */
CA_BAD_OPT = 402, /**< Bad Option */
private final CharSequence[] mResponseResultCheckBoxItems = {
ResponseResult.CA_SUCCESS.name(), ResponseResult.CA_CREATED.name(),
- ResponseResult.CA_DELETED.name(), ResponseResult.CA_EMPTY.name(),
- ResponseResult.CA_BAD_REQ.name(), ResponseResult.CA_BAD_OPT.name(),
- ResponseResult.CA_NOT_FOUND.name(),
+ ResponseResult.CA_DELETED.name(), ResponseResult.CA_VALID.name(),
+ ResponseResult.CA_CHANGED.name(), ResponseResult.CA_CONTENT.name(),
+ ResponseResult.CA_EMPTY.name(), ResponseResult.CA_BAD_REQ.name(),
+ ResponseResult.CA_BAD_OPT.name(), ResponseResult.CA_NOT_FOUND.name(),
ResponseResult.CA_INTERNAL_SERVER_ERROR.name(),
ResponseResult.CA_RETRANSMIT_TIMEOUT.name() };
};
private enum ResponseResult {
- CA_SUCCESS, CA_CREATED, CA_DELETED, CA_EMPTY, CA_BAD_REQ, CA_BAD_OPT,
- CA_NOT_FOUND, CA_INTERNAL_SERVER_ERROR, CA_RETRANSMIT_TIMEOUT
+ CA_SUCCESS, CA_CREATED, CA_DELETED, CA_VALID, CA_CHANGED, CA_CONTENT, CA_EMPTY,
+ CA_BAD_REQ, CA_BAD_OPT, CA_NOT_FOUND, CA_INTERNAL_SERVER_ERROR, CA_RETRANSMIT_TIMEOUT
}
private boolean mCheckedItems[] = {
.ordinal()) {
responseValue = 202;
DLog.v(TAG, "Response Value is CA_DELETED");
+ } else if (selectedResponseValue == ResponseResult.CA_VALID
+ .ordinal()) {
+ responseValue = 203;
+ DLog.v(TAG, "Response Value is CA_VALID");
+ } else if (selectedResponseValue == ResponseResult.CA_CHANGED
+ .ordinal()) {
+ responseValue = 204;
+ DLog.v(TAG, "Response Value is CA_CHANGED");
+ } else if (selectedResponseValue == ResponseResult.CA_CONTENT
+ .ordinal()) {
+ responseValue = 205;
+ DLog.v(TAG, "Response Value is CA_CONTENT");
} else if (selectedResponseValue == ResponseResult.CA_EMPTY
.ordinal()) {
responseValue = 0;
strcpy(respondData.resourceUri, resourceUri);
CAResponseInfo_t responseInfo = {CA_BAD_REQ, {CA_MSG_RESET}};
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = respondData;
// send request
Serial.println("Success: 200");
Serial.println("Created: 201");
Serial.println("Deleted: 202");
+ Serial.println("Valid : 203");
+ Serial.println("Changed: 204");
+ Serial.println("Content: 205");
Serial.println("BadReq : 400");
Serial.println("BadOpt : 402");
Serial.println("NotFnd : 404");
static const char SECURE_COAPS_PREFIX[] = "coaps://";
static const char SECURE_INFO_DATA[] =
"{\"oc\":[{\"href\":\"%s\",\"prop\":{\"rt\":[\"core.led\"],"
- "\"if\":[\"oic.if.baseline\"],\"obs\":1,\"sec\":1,\"port\":%d}}]}";
+ "\"if\":[\"oic.if.baseline\"],\"obs\":1,\"sec\":1,\"port\":"
+ "%d}}]}";
static const char NORMAL_INFO_DATA[] =
"{\"oc\":[{\"href\":\"%s\",\"prop\":{\"rt\":[\"core.led\"],"
"\"if\":[\"oic.if.baseline\"],\"obs\":1}}]}";
respondData.resourceUri = (CAURI_t)uri;
CAResponseInfo_t responseInfo = { 0 };
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = respondData;
// send request
printf("SUCCESS : 200\n");
printf("CREATED : 201\n");
printf("DELETED : 202\n");
+ printf("VALID : 203\n");
+ printf("CHANGED : 204\n");
+ printf("CONTENT : 205\n");
printf("BAD_REQ : 400\n");
printf("BAD_OPT : 402\n");
printf("NOT_FOUND : 404\n");
respondData.type = messageType;
CAResponseInfo_t responseInfo = { 0 };
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = respondData;
// send notification
printf("SUCCESS : 200\n");
printf("CREATED : 201\n");
printf("DELETED : 202\n");
+ printf("VALID : 203\n");
+ printf("CHANGED : 204\n");
+ printf("CONTENT : 205\n");
printf("BAD_REQ : 400\n");
printf("BAD_OPT : 402\n");
printf("NOT_FOUND : 404\n");
case CA_SUCCESS:
case CA_CREATED:
case CA_DELETED:
+ case CA_VALID:
+ case CA_CHANGED:
+ case CA_CONTENT:
case CA_BAD_REQ:
case CA_BAD_OPT:
case CA_NOT_FOUND:
requestData.tokenLength = tokenLength;
memset(&responseInfo, 0, sizeof(CAResponseInfo_t));
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = responseData;
EXPECT_EQ(CA_STATUS_OK, CASendResponse(tempRep, &responseInfo));
requestData.tokenLength = tokenLength;
memset(&responseInfo, 0, sizeof(CAResponseInfo_t));
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = responseData;
EXPECT_EQ(CA_STATUS_OK, CASendResponse(tempRep, &responseInfo));
requestData.tokenLength = tokenLength;
memset(&responseInfo, 0, sizeof(CAResponseInfo_t));
- responseInfo.result = CA_SUCCESS;
+ responseInfo.result = CA_CONTENT;
responseInfo.info = responseData;
EXPECT_EQ(CA_STATUS_OK, CASendNotification(tempRep, &responseInfo));