using namespace std;
namespace PH = std::placeholders;
+static const char* SVR_DB_FILE_NAME = "./oic_svr_db_server.dat";
int gObservation = 0;
void * ChangeLightRepresentation (void *param);
void * handleSlowResponse (void *param, std::shared_ptr<OCResourceRequest> pRequest);
std::cout << " 4 - Non-secure resource, GET slow response, notify all observers\n";
}
+static FILE* client_open(const char* /*path*/, const char *mode)
+{
+ return fopen(SVR_DB_FILE_NAME, mode);
+}
int main(int argc, char* argv[])
{
PrintUsage();
+ OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink };
if (argc == 1)
{
OC::ModeType::Server,
"0.0.0.0", // By setting to "0.0.0.0", it binds to all available interfaces
0, // Uses randomly available port
- OC::QualityOfService::LowQos
+ OC::QualityOfService::LowQos,
+ &ps
};
OCPlatform::Configure(cfg);