X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fexamples%2Fsimpleclient.cpp;h=bb7620cd423595ef3591338daca6557bcdac2e75;hb=8c01dff2c5bc5496f7dc1632c498943ec6ecb015;hp=e06d7318de79350a3faf38037fc69c98e67920d1;hpb=935fdb9b67b6c10d007e652e9e2e028fd6ccfe09;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/examples/simpleclient.cpp b/resource/examples/simpleclient.cpp index e06d731..bb7620c 100644 --- a/resource/examples/simpleclient.cpp +++ b/resource/examples/simpleclient.cpp @@ -412,16 +412,21 @@ void checkObserverValue(int value) } } +static FILE* client_open(const char *path, const char *mode) +{ + return fopen("./oic_svr_db_client.json", mode); +} + int main(int argc, char* argv[]) { std::ostringstream requestURI; - + OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink }; try { printUsage(); if (argc == 1) { - std::cout << "<===Setting ObserveType to Observe and ConnectivityType to IPv4===>\n\n"; + std::cout << "<===Setting ObserveType to Observe and ConnectivityType to IP===>\n\n"; } else if (argc == 2) { @@ -442,10 +447,11 @@ int main(int argc, char* argv[]) { // Create PlatformConfig object PlatformConfig cfg { OC::ServiceType::InProc, - OC::ModeType::Client, + OC::ModeType::Both, "0.0.0.0", 0, - OC::QualityOfService::LowQos + OC::QualityOfService::LowQos, + &ps }; OCPlatform::Configure(cfg); @@ -454,17 +460,17 @@ int main(int argc, char* argv[]) { // makes it so that all boolean values are printed as 'true/false' in this stream std::cout.setf(std::ios::boolalpha); // Find all resources - requestURI << OC_MULTICAST_DISCOVERY_URI << "?rt=core.light"; + requestURI << OC_RSRVD_WELL_KNOWN_URI;// << "?rt=core.light"; OCPlatform::findResource("", requestURI.str(), - OC_ALL, &foundResource); + CT_DEFAULT, &foundResource); std::cout<< "Finding Resource... " <