* It contains Server's Identity and the PSK credentials
* of other devices which the server trusts
*/
-static char CRED_FILE[] = "./oic_svr_db_server.json";
extern MPMCommonPluginCtx *g_com_ctx;
-FILE *serverFOpen(const char *path, const char *mode)
-{
- if (0 == strcmp(path, OC_SECURITY_DB_DAT_FILE_NAME))
- {
- return fopen(CRED_FILE, mode);
- }
- else
- {
- return fopen(path, mode);
- }
-}
-
std::unique_ptr<ConcurrentIotivityUtils> iotivityUtils = NULL;
/**
const uint BRIGHTNESS_CALLBACK = 1;
const uint CHROMA_CALLBACK = 2;
-const static char CRED_FILE[] = "./oic_svr_db_hue.dat";
-
-FILE *hue_fopen(const char * , const char *mode)
+FILE *hue_fopen(const char *path, const char *mode)
{
- return fopen(CRED_FILE, mode);
+ std::string filename = std::string("hue_") + path;
+ return fopen(filename.c_str(), mode);
}
MPMResult pluginCreate(MPMPluginCtx **pluginSpecificCtx)
static const std::string BRIGHTNESS_RELATIVE_URI = "/brightness";
std::string accessToken;
-const static char CRED_FILE[] = "./oic_svr_db_lifx.dat";
using namespace OC::Bridging;
static LifxLightSharedPtr getLifXLightFromOCFResourceUri(std::string resourceUri);
-FILE *lifxSecurityFile(const char *, const char *mode)
+FILE *lifxSecurityFile(const char *path, const char *mode)
{
- return fopen(CRED_FILE, mode);
+ std::string filename = std::string("lifx_") + path;
+ return fopen(filename.c_str(), mode);
}
MPMResult pluginCreate(MPMPluginCtx **pluginSpecificCtx)
void *accessTokenMonitorThread(void *pointer);
-static const char CRED_FILE[] = "./oic_svr_db_lyric.dat";
-
-FILE *honeywellFopen(const char *, const char *mode)
+FILE *honeywellFopen(const char *path, const char *mode)
{
- return fopen(CRED_FILE, mode);
+ std::string filename = std::string("lyric_") + path;
+ return fopen(filename.c_str(), mode);
}
MPMPluginCtx *g_pluginCtx = NULL;
static const std::string NEST_THERMOSTAT_IF = "oic.if.a";
static const std::string NEST_THERMOSTAT_RT = "oic.r.temperature";
-static const char CRED_FILE[] = "./oic_svr_db_nest.dat";
-
-FILE *nestSecurityFile(const char *, const char *mode)
+FILE *nestSecurityFile(const char *path, const char *mode)
{
- return fopen(CRED_FILE, mode);
+ std::string filename = std::string("nest_") + path;
+ return fopen(filename.c_str(), mode);
}
/*******************************************************************************
#define TAG "STUB_PLUGIN"
MPMPluginCtx *g_plugin_ctx = NULL;
-static char CRED_FILE[] = "./oic_svr_db_sample.dat";
FILE *sec_file(const char *, const char *mode)
{
- return fopen(CRED_FILE, mode);
+ std::string filename = "sample_" + path;
+ return fopen(filename.c_str(), mode);
}
MPMResult pluginCreate(MPMPluginCtx **pluginSpecificCtx)