From 8de3eba4e42d1392c9a1ac877cfeab02bf3afaf3 Mon Sep 17 00:00:00 2001 From: "ch79.cho" Date: Wed, 17 Aug 2016 13:15:00 +0900 Subject: [PATCH] Remove unnecessary attribute An attribute, NS_ATTRIBUTE_ACCEPTANCE, is removed as the usage has been changed. Instead the value of MessageID is set to NS_ALLOW(1) or NS_DENY(2) for the response of subscription. Change-Id: I48d6b34449602fec9e083620273f991a52ef4bbe Signed-off-by: ch79.cho Reviewed-on: https://gerrit.iotivity.org/gerrit/10527 Reviewed-by: Madan Lanka Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- service/notification/include/NSCommon.h | 1 - service/notification/src/provider/NSProviderSubscription.c | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/service/notification/include/NSCommon.h b/service/notification/include/NSCommon.h index a3c52ff..70ca1ca 100644 --- a/service/notification/include/NSCommon.h +++ b/service/notification/include/NSCommon.h @@ -35,7 +35,6 @@ #define NS_ATTRIBUTE_MESSAGE "MESSAGE_URI" #define NS_ATTRIBUTE_SYNC "SYNC_URI" #define NS_ATTRIBUTE_TOPIC "TOPIC_URI" -#define NS_ATTRIBUTE_ACCPETANCE "ACCEPTANCE" // not used #define NS_ATTRIBUTE_MESSAGE_ID "MESSAGE_ID" #define NS_ATTRIBUTE_PROVIDER_ID "PROVIDER_ID" #define NS_ATTRIBUTE_CONSUMER_ID "CONSUMER_ID" diff --git a/service/notification/src/provider/NSProviderSubscription.c b/service/notification/src/provider/NSProviderSubscription.c index 61aec35..238d0ed 100644 --- a/service/notification/src/provider/NSProviderSubscription.c +++ b/service/notification/src/provider/NSProviderSubscription.c @@ -263,8 +263,8 @@ NSResult NSSendResponse(const char * id, bool accepted) } OCRepPayloadSetUri(payload, NS_COLLECTION_MESSAGE_URI); - OCRepPayloadSetPropInt(payload, NS_ATTRIBUTE_MESSAGE_ID, 1); - OCRepPayloadSetPropBool(payload, NS_ATTRIBUTE_ACCPETANCE, accepted); + (accepted) ? OCRepPayloadSetPropInt(payload, NS_ATTRIBUTE_MESSAGE_ID, NS_ALLOW) + : OCRepPayloadSetPropInt(payload, NS_ATTRIBUTE_MESSAGE_ID, NS_DENY); OCRepPayloadSetPropString(payload, NS_ATTRIBUTE_PROVIDER_ID, NSGetProviderInfo()->providerId); NSCacheElement * element = NSStorageRead(consumerSubList, id); -- 2.7.4