static int64_t ConditionalAddIntToMap(CborEncoder *map, const char *tags, const uint64_t *value)
{
int64_t err = CborNoError;
- if (*value)
+ if (value)
{
err |= cbor_encode_text_string(map, tags, strlen(tags));
VERIFY_CBOR_SUCCESS(TAG, err, "failed setting value");
using namespace std;
using namespace OC;
+static const char* SVR_DB_FILE_NAME = "./oic_svr_db_server.dat";
+
string rdAddress;
OCConnectivityType connectivityType = CT_ADAPTER_TCP;
try
{
- if (OC_STACK_RESOURCE_CREATED == eCode)
+ if (OC_STACK_RESOURCE_CHANGED == eCode)
{
cout << "=========== Published Resource ===========" << endl;
if (rep.hasAttribute("di"))
std::cout<<"Usage: rdserver <coap+tcp://10.11.12.13:5683>\n";
}
+static FILE* client_open(const char* /*path*/, const char *mode)
+{
+ return fopen(SVR_DB_FILE_NAME, mode);
+}
+
int main(int argc, char* argv[])
{
ostringstream requestURI;
return -1;
}
+ OCPersistentStorage ps {client_open, fread, fwrite, fclose, unlink };
PlatformConfig config
- { OC::ServiceType::InProc, ModeType::Both, "0.0.0.0", 0, OC::QualityOfService::LowQos };
+ { OC::ServiceType::InProc, ModeType::Both, "0.0.0.0", 0, OC::QualityOfService::LowQos, &ps};
try
{