-
- // diagnostics members
- std::string m_timeUri;
- std::string m_timeValue;
- std::vector< std::string > m_timeTypes;
- std::vector< std::string > m_timeInterfaces;
- OCResourceHandle m_timeHandle;
- OCRepresentation m_timeRep;
-
- // factory reset members
- std::string m_currentTimeUri;
- std::string m_currentTimeValue;
- std::vector< std::string > m_currentTimeTypes;
- std::vector< std::string > m_currentTimeInterfaces;
- OCResourceHandle m_currentTimeHandle;
- OCRepresentation m_currentTimeRep;
-
-public:
- /// Constructor
- TimeCollection() :
- m_timeValue(defaultTimeValue), m_currentTimeValue(defaultCurrentTimeValue)
- {
- m_currentTimeUri = defaultURIPrefix + "/time/0/currentTime"; // URI of the resource
- m_currentTimeTypes.push_back("oic.con.time.currentTime"); // resource type name.
- m_currentTimeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_currentTimeRep.setUri(m_currentTimeUri);
- m_currentTimeRep.setResourceTypes(m_currentTimeTypes);
- m_currentTimeRep.setResourceInterfaces(m_currentTimeInterfaces);
- m_currentTimeRep.setValue("value", m_currentTimeValue);
- m_currentTimeHandle = NULL;
-
- m_timeUri = defaultURIPrefix + "/time"; // URI of the resource
- m_timeTypes.push_back("oic.con.time"); // resource type name.
- m_timeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_timeInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_timeInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_timeRep.setValue("value", m_timeValue);
- m_timeRep.setUri(m_timeUri);
- m_timeRep.setResourceTypes(m_timeTypes);
- m_timeRep.setResourceInterfaces(m_timeInterfaces);
- m_timeHandle = NULL;
- }
- ;
-
- /// Constructor
- TimeCollection(std::string URIPrefix, std::string ResourceTypePrefix) :
- m_timeValue(defaultTimeValue), m_currentTimeValue(defaultCurrentTimeValue)
- {
- m_currentTimeUri = URIPrefix + "/time/0/currentTime"; // URI of the resource
- m_currentTimeTypes.push_back(ResourceTypePrefix + ".time.currentTime"); // type name.
- m_currentTimeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_currentTimeRep.setUri(m_currentTimeUri);
- m_currentTimeRep.setResourceTypes(m_currentTimeTypes);
- m_currentTimeRep.setResourceInterfaces(m_currentTimeInterfaces);
- m_currentTimeRep.setValue("value", m_currentTimeValue);
- m_currentTimeHandle = NULL;
-
- m_timeUri = URIPrefix + "/time"; // URI of the resource
- m_timeTypes.push_back(ResourceTypePrefix + ".time"); // resource type name.
- m_timeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_timeInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_timeInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_timeRep.setValue("value", m_timeValue);
- m_timeRep.setUri(m_timeUri);
- m_timeRep.setResourceTypes(m_timeTypes);
- m_timeRep.setResourceInterfaces(m_timeInterfaces);
- m_timeHandle = NULL;
- }
- ;
-
- /// This function internally calls registerResource API.
- void createResources(ResourceEntityHandler callback);
-
- void setTimeRepresentation(OCRepresentation& rep);
- void setCurrentTimeRepresentation(OCRepresentation& rep);
-
- OCRepresentation getTimeRepresentation();
- OCRepresentation getCurrentTimeRepresentation();
-
- std::string getTimeUri();
- std::string getCurrentTimeUri();
-
- void factoryReset();
-
-};
-
-extern std::string defaultNetworkValue;
-extern std::string defaultIPAddressValue;
-
-class NetworkCollection
-{
-public:
-
- // diagnostics members
- std::string m_networkUri;
- std::string m_networkValue;
- std::vector< std::string > m_networkTypes;
- std::vector< std::string > m_networkInterfaces;
- OCResourceHandle m_networkHandle;
- OCRepresentation m_networkRep;
-
- // factory reset members
- std::string m_IPAddressUri;
- std::string m_IPAddressValue;
- std::vector< std::string > m_IPAddressTypes;
- std::vector< std::string > m_IPAddressInterfaces;
- OCResourceHandle m_IPAddressHandle;
- OCRepresentation m_IPAddressRep;
-
-public:
-
- /// Constructor
- NetworkCollection() :
- m_networkValue(defaultNetworkValue), m_IPAddressValue(defaultIPAddressValue)
- {
- m_IPAddressUri = defaultURIPrefix + "/network/0/IPAddress"; // URI of the resource
- m_IPAddressTypes.push_back("oic.con.network.IPAddress"); // resource type name.
- m_IPAddressInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_IPAddressRep.setUri(m_IPAddressUri);
- m_IPAddressRep.setResourceTypes(m_IPAddressTypes);
- m_IPAddressRep.setResourceInterfaces(m_IPAddressInterfaces);
- m_IPAddressRep.setValue("value", m_IPAddressValue);
- m_IPAddressHandle = NULL;
-
- m_networkUri = defaultURIPrefix + "/network"; // URI of the resource
- m_networkTypes.push_back("oic.con.network"); // resource type name.
- m_networkInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_networkInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_networkInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_networkRep.setValue("value", m_networkValue);
- m_networkRep.setUri(m_networkUri);
- m_networkRep.setResourceTypes(m_networkTypes);
- m_networkRep.setResourceInterfaces(m_networkInterfaces);
- m_networkHandle = NULL;
- }
- ;
-
- /// Constructor
- NetworkCollection(std::string URIPrefix, std::string ResourceTypePrefix) :
- m_networkValue(defaultNetworkValue), m_IPAddressValue(defaultIPAddressValue)
- {
- m_IPAddressUri = URIPrefix + "/network/0/IPAddress"; // URI of the resource
- m_IPAddressTypes.push_back(ResourceTypePrefix + "network.IPAddress"); // resource type name.
- m_IPAddressInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_IPAddressRep.setUri(m_IPAddressUri);
- m_IPAddressRep.setResourceTypes(m_IPAddressTypes);
- m_IPAddressRep.setResourceInterfaces(m_IPAddressInterfaces);
- m_IPAddressRep.setValue("value", m_IPAddressValue);
- m_IPAddressHandle = NULL;
-
- m_networkUri = URIPrefix + "/network"; // URI of the resource
- m_networkTypes.push_back(ResourceTypePrefix + ".network"); // resource type name.
- m_networkInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_networkInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_networkInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_networkRep.setValue("value", m_networkValue);
- m_networkRep.setUri(m_networkUri);
- m_networkRep.setResourceTypes(m_networkTypes);
- m_networkRep.setResourceInterfaces(m_networkInterfaces);
- m_networkHandle = NULL;
- }
- ;
-
- /// This function internally calls registerResource API.
- void createResources(ResourceEntityHandler callback);
-
- void setNetworkRepresentation(OCRepresentation& rep);
- void setIPAddressRepresentation(OCRepresentation& rep);
-
- OCRepresentation getNetworkRepresentation();
- OCRepresentation getIPAddressRepresentation();
-
- std::string getNetworkUri();
- std::string getIPAddressUri();
-
- void factoryReset();
-
-};
-
-extern std::string defaultSecurityValue;
-extern std::string defaultModeValue;
-
-class SecurityCollection
-{
-public:
-
- // diagnostics members
- std::string m_securityUri;
- std::string m_securityValue;
- std::vector< std::string > m_securityTypes;
- std::vector< std::string > m_securityInterfaces;
- OCResourceHandle m_securityHandle;
- OCRepresentation m_securityRep;
-
- // factory reset members
- std::string m_modeUri;
- std::string m_modeValue;
- std::vector< std::string > m_modeTypes;
- std::vector< std::string > m_modeInterfaces;
- OCResourceHandle m_modeHandle;
- OCRepresentation m_modeRep;
-
-public:
- /// Constructor
- SecurityCollection() :
- m_securityValue(defaultSecurityValue), m_modeValue(defaultModeValue)
- {
- m_modeUri = defaultURIPrefix + "/security/0/mode"; // URI of the resource
- m_modeTypes.push_back("oic.con.security.mode"); // resource type name.
- m_modeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_modeRep.setUri(m_modeUri);
- m_modeRep.setResourceTypes(m_modeTypes);
- m_modeRep.setResourceInterfaces(m_modeInterfaces);
- m_modeRep.setValue("value", m_modeValue);
- m_modeHandle = NULL;
-
- m_securityUri = defaultURIPrefix + "/security"; // URI of the resource
- m_securityTypes.push_back("oic.con.security"); // resource type name.
- m_securityInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_securityInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_securityInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_securityRep.setValue("value", m_securityValue);
- m_securityRep.setUri(m_securityUri);
- m_securityRep.setResourceTypes(m_securityTypes);
- m_securityRep.setResourceInterfaces(m_securityInterfaces);
- m_securityHandle = NULL;
- }
- ;
-
- /// Constructor
- SecurityCollection(std::string URIPrefix, std::string ResourceTypePrefix) :
- m_securityValue(defaultSecurityValue), m_modeValue(defaultModeValue)
- {
- m_modeUri = URIPrefix + "/security/0/mode"; // URI of the resource
- m_modeTypes.push_back(ResourceTypePrefix + ".security.mode"); // resource type name.
- m_modeInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
-
- m_modeRep.setUri(m_modeUri);
- m_modeRep.setResourceTypes(m_modeTypes);
- m_modeRep.setResourceInterfaces(m_modeInterfaces);
- m_modeRep.setValue("value", m_modeValue);
- m_modeHandle = NULL;
-
- m_securityUri = URIPrefix + "/security"; // URI of the resource
- m_securityTypes.push_back(ResourceTypePrefix + ".security"); // resource type name.
- m_securityInterfaces.push_back(DEFAULT_INTERFACE); // resource interface.
- m_securityInterfaces.push_back(BATCH_INTERFACE); // resource interface.
- m_securityInterfaces.push_back(LINK_INTERFACE); // resource interface.
- m_securityRep.setValue("value", m_securityValue);
- m_securityRep.setUri(m_securityUri);
- m_securityRep.setResourceTypes(m_securityTypes);
- m_securityRep.setResourceInterfaces(m_securityInterfaces);
- m_securityHandle = NULL;
- }
- ;
-
- /// This function internally calls registerResource API.
- void createResources(ResourceEntityHandler callback);
-
- void setSecurityRepresentation(OCRepresentation& rep);
- void setModeRepresentation(OCRepresentation& rep);
-
- OCRepresentation getSecurityRepresentation();
- OCRepresentation getModeRepresentation();
-
- std::string getSecurityUri();
- std::string getModeUri();
-
- void factoryReset();
-
-};
-
-extern std::string defaultConfigurationValue;
-extern std::string defaultRegionValue;
-static std::string defaultTimeLink = "/con/con/0/time";
-static std::string defaultNetworkLink = "/con/con/0/network";
-static std::string defaultSecurityLink = "/con/con/0/security";
-
-class ConfigurationCollection
-{
-public:
- TimeCollection *myTimeCollection;
- NetworkCollection *myNetworkCollection;
- SecurityCollection *mySecurityCollection;
-
-public: