#define CLOUD_CONTEXT_VALUE 0x99
char CLOUD_ADDRESS[100];
+char CLOUD_TOPIC[100];
char CLOUD_AUTH_PROVIDER[100];
char CLOUD_AUTH_CODE[100];
char CLOUD_UID[100];
printf("4. Select Topics\n");
printf("5. Cancel select Topics\n");
printf("0. Exit\n");
+#ifdef WITH_MQ
+ printf("11. Subscribe MQ Service\n");
+#endif
#ifdef WITH_CLOUD
printf("21. Enable Remote Service (after login)\n");
printf("31. Cloud Signup\n");
printf("0. Exit");
isExit = true;
break;
+#if WITH_MQ
+ case 11:
+ printf("11. Subscribe MQ Service\n");
+
+ printf("Remote Server Address: ");
+ input(CLOUD_ADDRESS);
+
+ printf("Topic[notification]: ");
+ input(CLOUD_TOPIC);
+
+ NSConsumerSubscribeMQService(CLOUD_ADDRESS, CLOUD_TOPIC);
+ break;
+#endif
#ifdef WITH_CLOUD
case 21:
printf("Enable Remote Service");
NSOICFree(topicAddr->serverAddr);
NSOICFree(topicAddr->topicName);
});
- OCStackResult ret = NSInvokeRequest(NULL, OC_REST_GET, addr, serverUri, NULL,
+
+ char requestUri[100] = "coap+tcp://";
+ OICStrcat(requestUri, strlen(requestUri)+strlen(serverUri)+1, serverUri);
+ OICStrcat(requestUri, strlen(requestUri)+ strlen("/oic/ps") + 1, "/oic/ps");
+ NS_LOG_V(DEBUG, "requestUri = %s", requestUri);
+
+ OCStackResult ret = NSInvokeRequest(NULL, OC_REST_GET, addr, requestUri, NULL,
NSConsumerIntrospectMQTopic, topicName, OICFree, CT_DEFAULT);
NS_VERIFY_NOT_NULL_WITH_POST_CLEANING_V(NSOCResultToSuccess(ret) == true ? (void *)1 : NULL,
{