using namespace OC;
-//Set of strings for each of deviceInfo fields
+//Set of strings for each of platform Info fields
std::string dateOfManufacture = "myDateOfManufacture";
std::string firmwareVersion = "my.Firmware.Version";
std::string manufacturerName = "myName";
std::string supportUrl = "www.mysupporturl.com";
std::string systemTime = "mySystemTime";
-//Set of strings for each of platform info fields
+//Set of strings for each of device info fields
std::string deviceName = "Bill's Battlestar";
+std::string specVersion = "myDeviceSpecVersion";
+std::string dataModelVersions = "myDeviceModelVersion";
//OCPlatformInfo Contains all the platform info to be stored
OCPlatformInfo platformInfo;
void DeleteDeviceInfo()
{
delete[] deviceInfo.deviceName;
+ delete[] deviceInfo.specVersion;
+ OCFreeOCStringLL(deviceInfo.dataModelVersions);
}
void DuplicateString(char ** targetString, std::string sourceString)
}
-OCStackResult SetDeviceInfo(std::string deviceName)
+OCStackResult SetDeviceInfo(std::string deviceName, std::string specVersion, std::string dataModelVersions)
{
DuplicateString(&deviceInfo.deviceName, deviceName);
+
+ if (!specVersion.empty())
+ DuplicateString(&deviceInfo.specVersion, specVersion);
+
+ if (!dataModelVersions.empty())
+ OCResourcePayloadAddStringLL(&deviceInfo.dataModelVersions, dataModelVersions.c_str());
+
return OC_STACK_OK;
}
}
- result = SetDeviceInfo(deviceName);
+ result = SetDeviceInfo(deviceName, specVersion, dataModelVersions);
OCResourcePayloadAddStringLL(&deviceInfo.types, "oic.wk.d");
OCResourcePayloadAddStringLL(&deviceInfo.types, "oic.d.tv");