X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Fexamples%2Flinux%2Fnotificationprovider.c;h=11c1c36733fbde20058082c426cb47a486e564c3;hb=refs%2Ftags%2Fsubmit%2Ftizen_4.0%2F20171010.021147;hp=c86466978cc77e56cfb2f1c32d79bbe63fb817ab;hpb=3132474f6246c0b15a63fcf4a7dc97d8bd622706;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/examples/linux/notificationprovider.c b/service/notification/examples/linux/notificationprovider.c index c864669..11c1c36 100644 --- a/service/notification/examples/linux/notificationprovider.c +++ b/service/notification/examples/linux/notificationprovider.c @@ -22,7 +22,6 @@ #include #include #include -#include #include "NSProviderInterface.h" #include "NSCommon.h" @@ -46,6 +45,11 @@ char UID[50] = {'\0',}; char ACCESS_TOKEN[50] = {'\0',}; #endif +#ifdef WITH_MQ +char CLOUD_ADDRESS[100] = "10.113.64.52:5686"; +char CLOUD_TOPIC[100] = "/oic/ps/notification"; +#endif + char mainConsumer[37] = {'\0',}; extern char *strdup(const char *s); @@ -181,7 +185,8 @@ int main() printf("8. NSProviderUnselectTopic(); \n"); printf("9. NSProviderGetConsumerTopics(); \n"); printf("10. NSProviderGetTopics(); \n"); - printf("11. NSStopProvider() \n"); + printf("11. NSProviderSubscribeMQService() \n"); + printf("0. NSStopProvider() \n"); #ifdef WITH_CLOUD printf("21. NSProviderEnableRemoteService (after login) \n"); printf("22. NSProviderDisableRemoteService (after login) \n"); @@ -194,7 +199,7 @@ int main() printf("input : "); - if(scanf("%d", &num) > 0 && isdigit(num) == 0) + if(scanf("%d", &num) > 0) { if(scanf("%c", &dummy) > 0) { @@ -249,6 +254,7 @@ int main() input(body); printf("topic : "); + input(topic); printf("app - mTitle : %s \n", title); @@ -321,9 +327,20 @@ int main() } break; +#if WITH_MQ case 11: - NSStopProvider(); + printf("11. Subscribe MQ Service\n"); + + printf("Remote Server Address: "); + //input(CLOUD_ADDRESS); + + printf("Topic[notificationtest]: "); + //input(CLOUD_TOPIC); + + NSProviderSubscribeMQService(CLOUD_ADDRESS, CLOUD_TOPIC); break; +#endif + #ifdef WITH_CLOUD case 21: printf("Enable Remote Service\n");