Update Provider Example.
authorjaesick.shin <jaesick.shin@samsung.com>
Fri, 19 Aug 2016 02:15:48 +0000 (11:15 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 19 Aug 2016 07:08:31 +0000 (07:08 +0000)
Add User input logic for topic.

Change-Id: I0308f4bf28c222ebb164bf824668579075e058e5
Signed-off-by: jaesick.shin <jaesick.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10633
Reviewed-by: Chihyun Cho <ch79.cho@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
service/notification/examples/linux/notificationprovider.c

index d2f348c..fc1da96 100644 (file)
@@ -237,6 +237,7 @@ int main()
                 printf("NSSendNotification()");\r
                 char title[100];\r
                 char body[100];\r
+                char topic[100];\r
 \r
                 printf("id : %d\n", ++id);\r
                 printf("title : ");\r
@@ -246,8 +247,12 @@ int main()
                 printf("body : ");\r
                 gets(body);\r
 \r
+                printf("topic : ");\r
+                gets(topic);\r
+\r
                 printf("app - mTitle : %s \n", title);\r
                 printf("app - mContentText : %s \n", body);\r
+                printf("app - topic : %s \n", topic);\r
 \r
                 NSMessage * msg = NSCreateMessage();\r
 \r
@@ -255,6 +260,11 @@ int main()
                 msg->contentText = OICStrdup(body);\r
                 msg->sourceName = OICStrdup("OCF");\r
 \r
+                if(topic[0] != '\0')\r
+                {\r
+                    msg->topic = OICStrdup(topic);\r
+                }\r
+\r
                 NSSendMessage(msg);\r
             }\r
                 break;\r