X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=service%2Fnotification%2Fcpp-wrapper%2Fexamples%2Flinux%2Fnotificationserviceprovider.cpp;h=339d1f0261ee948fec8dacb643658694f4b872c0;hb=0c1157cd13a40a604cbd68c6d01f884bb06e9c1b;hp=3e9302533edf014331d97b7ba9467bba0b00bd5f;hpb=96d123a6592a8657ad1478890097569bf8fee440;p=platform%2Fupstream%2Fiotivity.git diff --git a/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp b/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp index 3e93025..339d1f0 100755 --- a/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp +++ b/service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp @@ -111,7 +111,9 @@ int main() NSProviderService::ProviderConfig cfg; cfg.m_subscribeRequestCb = subscribeRequestCallback; cfg.m_syncInfoCb = syncCallback; - NSProviderService::getInstance()->Start(NSProviderService::NSAccessPolicy::NS_ACCESS_ALLOW, cfg); + cfg.policy = (bool) NSProviderService::NSAccessPolicy::NS_ACCESS_ALLOW; + + NSProviderService::getInstance()->Start(cfg); break; } case 2: @@ -120,7 +122,9 @@ int main() NSProviderService::ProviderConfig cfg; cfg.m_subscribeRequestCb = subscribeRequestCallback; cfg.m_syncInfoCb = syncCallback; - NSProviderService::getInstance()->Start(NSProviderService::NSAccessPolicy::NS_ACCESS_DENY, cfg); + cfg.policy = (bool) NSProviderService::NSAccessPolicy::NS_ACCESS_DENY; + + NSProviderService::getInstance()->Start(cfg); break; } case 3: @@ -141,12 +145,11 @@ int main() std::cout << "app - mTitle : " << title << std::endl; std::cout << "app - mContentText : " << body << std::endl; - OIC::Service::NSMessage *msg = new OIC::Service::NSMessage(); + OIC::Service::NSMessage *msg = NSProviderService::getInstance()->CreateMessage(); + msg->setType(OIC::Service::NSMessage::NSMessageType::NS_MESSAGE_INFO); msg->setTitle(title.c_str()); msg->setContentText(body.c_str()); - msg->setTime(""); - msg->setTTL(0); msg->setSourceName("OCF"); NSProviderService::getInstance()->SendMessage(msg);