}
}
+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)
{
// 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);
// 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... " <<std::endl;
// Find resource is done twice so that we discover the original resources a second time.
// These resources will have the same uniqueidentifier (yet be different objects), so that
// we can verify/show the duplicate-checking code in foundResource(above);
OCPlatform::findResource("", requestURI.str(),
- OC_ALL, &foundResource);
+ CT_DEFAULT, &foundResource);
std::cout<< "Finding Resource for second time..." << std::endl;
// A condition variable will free the mutex it is given, then do a non-