IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NSCommon.h
Go to the documentation of this file.
1 //******************************************************************
2 //
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 
27 #ifndef _NS_COMMON_H_
28 #define _NS_COMMON_H_
29 
30 #include <stdint.h>
31 #include <octypes.h>
32 
33 #define NS_UUID_STRING_SIZE 37
34 //#define WITH_MQ
38 typedef enum eResult
39 {
40  NS_OK = 100,
41  NS_ERROR = 200,
42  NS_SUCCESS = 300,
43  NS_FAIL = 400,
44 
45 } NSResult;
46 
50 typedef enum
51 {
52  NS_ALLOW = 1,
53  NS_DENY = 2,
54  NS_TOPIC = 3,
57 
59 
63 typedef enum
64 {
68 
69 } NSSyncType;
70 
78 typedef enum
79 {
87 
89 
93 typedef enum
94 {
97 
98 } NSTopicState;
99 
103 typedef struct _nsTopic
104 {
105  char * topicName;
107  struct _nsTopic * next;
108 
109 } NSTopicLL;
110 
114 typedef struct
115 {
116  char consumerId[NS_UUID_STRING_SIZE];
117 
118 } NSConsumer;
119 
123 typedef struct
124 {
125  char providerId[NS_UUID_STRING_SIZE];
126 
127 } NSProvider;
128 
132 typedef struct
133 {
134  char * iconImage;
135 
137 
141 typedef struct
142 {
143  //Mandatory
144  uint64_t messageId;
145  char providerId[NS_UUID_STRING_SIZE];
146 
147  //optional
149  char * dateTime;
150  uint64_t ttl;
151  char * title;
152  char * contentText;
153  char * sourceName;
155  char * topic;
157 
158 } NSMessage;
159 
163 typedef struct
164 {
165  uint64_t messageId;
166  char providerId[NS_UUID_STRING_SIZE];
168 
169 } NSSyncInfo;
170 
171 #endif /* _NS_COMMON_H_ */
172 
Definition: NSCommon.h:95
Definition: NSCommon.h:81
Definition: NSCommon.h:67
Definition: NSCommon.h:54
#define NS_UUID_STRING_SIZE
Definition: NSCommon.h:33
Definition: NSCommon.h:65
Media Contents of Notification Message (Optional)
Definition: NSCommon.h:132
NSSyncType state
Definition: NSCommon.h:167
Definition: NSCommon.h:83
uint64_t ttl
Definition: NSCommon.h:150
Synchronization information of the notification message.
Definition: NSCommon.h:163
Definition: NSCommon.h:53
Notification Message.
Definition: NSCommon.h:141
Definition: NSCommon.h:84
Provider information.
Definition: NSCommon.h:123
Definition: NSCommon.h:55
NSMediaContents * mediaContents
Definition: NSCommon.h:154
Definition: NSCommon.h:85
Definition: octypes.h:1523
eResult
Result code of notification service.
Definition: NSCommon.h:38
Definition: NSCommon.h:96
uint64_t messageId
Definition: NSCommon.h:144
NSProviderState
Provider state of notification consumer service.
Definition: NSCommon.h:50
Definition: NSCommon.h:86
char * iconImage
Definition: NSCommon.h:134
NSMessageType
Notification Message Type Alert mean is High / critical Notice mean is low / critical Event mean is H...
Definition: NSCommon.h:78
This file contains the definition, types and APIs for resource(s) be implemented. ...
char * title
Definition: NSCommon.h:151
NSMessageType type
Definition: NSCommon.h:148
NSTopicState state
Definition: NSCommon.h:106
Definition: NSCommon.h:56
Topic linked list.
Definition: NSCommon.h:103
char * contentText
Definition: NSCommon.h:152
Definition: NSCommon.h:80
NSTopicState
Notification topic state.
Definition: NSCommon.h:93
Definition: NSCommon.h:41
NSSyncType
Notification message status to synchronize.
Definition: NSCommon.h:63
Definition: NSCommon.h:42
OCRepPayload * extraInfo
Definition: NSCommon.h:156
Definition: NSCommon.h:43
Definition: NSCommon.h:40
struct _nsTopic * next
Definition: NSCommon.h:107
Consumer information.
Definition: NSCommon.h:114
char * dateTime
Definition: NSCommon.h:149
char * topicName
Definition: NSCommon.h:105
struct _nsTopic NSTopicLL
Topic linked list.
Definition: NSCommon.h:52
Definition: NSCommon.h:66
enum eResult NSResult
Result code of notification service.
Definition: NSCommon.h:82
char * sourceName
Definition: NSCommon.h:153
uint64_t messageId
Definition: NSCommon.h:165
char * topic
Definition: NSCommon.h:155