public:
std::string m_bundleId;
- std::string m_name, m_uri, m_resourceType, m_address;
+ std::string m_name, m_uri, m_resourceType, m_interface, m_address;
std::map< std::string,
std::vector< std::map< std::string, std::string > > > m_mapResourceProperty;
{
string strUri = resource->m_uri;
string strResourceType = resource->m_resourceType;
+ string strInterface = resource->m_interface;
RCSResourceObject::Ptr server = nullptr;
int ret = EINVAL;
registrationLock.lock();
if (m_mapResources.find(strUri) == m_mapResources.end())
{
- server = buildResourceObject(strUri, strResourceType);
+ if (strInterface.empty()) {
+ strInterface = "oic.if.baseline";
+ }
+
+ server = buildResourceObject(strUri, strResourceType, strInterface);
if (server != nullptr)
{
}
RCSResourceObject::Ptr ResourceContainerImpl::buildResourceObject(const std::string &strUri,
- const std::string &strResourceType)
+ const std::string &strResourceType, const std::string &strInterface)
{
return RCSResourceObject::Builder(strUri, strResourceType,
- "oic.if.baseline").setObservable(
+ strInterface).setObservable(
true).setDiscoverable(true).build();
}
static ResourceContainerImpl *getImplInstance();
static RCSResourceObject::Ptr buildResourceObject(const std::string &strUri,
- const std::string &strResourceType);
+ const std::string &strResourceType, const std::string &strInterface);
void startBundle(const std::string &bundleId);
void stopBundle(const std::string &bundleId);
m_pBundleResource->m_resourceType = "container.test";
mocks.ExpectCallFunc(ResourceContainerImpl::buildResourceObject).With(m_pBundleResource->m_uri,
- m_pBundleResource->m_resourceType).Return(nullptr);
+ m_pBundleResource->m_resourceType, m_pBundleResource->m_interface).Return(nullptr);
m_pResourceContainer->registerResource(m_pBundleResource);
}