#define NS_DISCOVER_QUERY "/oic/res?rt=oic.r.notification"
-typedef OCStackApplicationResult (*onRIResponseListener)(
- void *, OCDoHandle, OCClientResponse *);
+#define NS_VERTIFY_NOT_NULL_V(obj) { if ((obj) == NULL) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is null", __func__); \
+ return; \
+ }}
+
+#define NS_VERTIFY_NOT_NULL(obj, retVal) { if ((obj) == NULL) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is null", __func__); \
+ return (retVal); \
+ }}
+
+#define NS_VERTIFY_NOT_NULL_WITH_POST_CLEANING(obj, retVal, func) { \
+ if ((obj) == NULL) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is null", __func__); \
+ NS_LOG(ERROR, "execute deletion"); \
+ (func); \
+ return (retVal); \
+ }}
+
+#define NS_VERTIFY_STACK_OK_V(obj) { OCStackResult _ret = (obj); \
+ if ( _ret != OC_STACK_OK) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is not OC_STACK_OK : %d", __func__, _ret); \
+ return; \
+ }}
+
+#define NS_VERTIFY_STACK_OK(obj, retVal) { OCStackResult _ret = (obj); \
+ if ( _ret != OC_STACK_OK) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is not OC_STACK_OK : %d", __func__, _ret); \
+ return (retVal); \
+ }}
+
+#define NS_VERTIFY_STACK_OK_WITH_POST_CLEANING(obj, retVal, func) { \
+ OCStackResult _ret = (obj); \
+ if ( _ret != OC_STACK_OK) \
+ { \
+ NS_LOG_V(ERROR, "%s : obj is not OC_STACK_OK : %d", __func__, _ret); \
+ (func); \
+ return (retVal); \
+ }}
typedef enum
{
//Optional
char * mContentText;
+ char * mSource;
OCDevAddr * addr;
char * syncUri;
void NSNotificationPost(NSProvider * provider, NSMessage * obj);
void NSSetNotificationSyncCb(NSSyncCallback cb);
-void NSNotificationSync(NSProvider * provider, NSSync * sync);
-
-onRIResponseListener NSGetResponseListener();
-void NSSetResponseListener(onRIResponseListener cb);
+void NSNotificationSync(NSProvider * provider, NSSyncInfo * sync);
NSTask * NSMakeTask(NSTaskType, void *);
NSMessage_consumer * NSCopyMessage(NSMessage_consumer *);
void NSRemoveMessage(NSMessage_consumer *);
-OCStackResult NSRequestToResourceIntrospection(OCDoHandle * handle,
+OCStackResult NSInvokeRequest(OCDoHandle * handle,
OCMethod method, const OCDevAddr * addr,
- const char * queryUrl, OCPayload * payload, void * callback);
+ const char * queryUrl, OCPayload * payload,
+ void * callbackFunc, void * callbackData);
#ifdef __cplusplus
}