resourceClient_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-resourceClient_env.PrependUnique(LIBS = ['oc', 'ResourceBroker' , 'ResourceCache', 'service_common', 'octbstack', 'gnustl_shared','oc_logger', 'compatibility', 'log'])
+resourceClient_env.PrependUnique(LIBS = ['oc', 'service_common', 'ResourceBroker' , 'ResourceCache', 'octbstack', 'gnustl_shared','oc_logger', 'compatibility', 'log'])
if target_os not in ['windows', 'winrt']:
######################################################################
# Source files and Targets
######################################################################
-# resourceClient_src = 'src/'
-# client_src = [
-# resourceClient_src+ 'ResourceClient.cpp']
-#ResourceClientsdk = resourceClient_env.StaticLibrary('ResourceClient', client_src)
-# resourceClient_env.InstallTarget(ResourceClientsdk , 'libResourceClient')
+resourceClient_src = 'src/'
+client_src = [
+ resourceClient_src+ 'ResourceClient.cpp']
+ResourceClientsdk = resourceClient_env.StaticLibrary('ResourceClient', client_src)
+resourceClient_env.InstallTarget(ResourceClientsdk , 'libResourceClient')
######################################################################
# Build Sample App: SampleResourceClient & SampleResourceServer
######################################################################
-# SConscript('examples/SConscript')
+SConscript('examples/SConscript')
+
######################################################################
# Build UnitTests Resource Client
################################################ ######################
-# SConscript('unittests/SConscript')
+SConscript('unittests/SConscript')
ResourceClient_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
ResourceClient_env.AppendUnique(LIBS = ['ResourceClient','ResourceCache', 'ResourceBroker', 'ExpiryTimer','service_common','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'pthread'])
+ResourceClient_env.AppendUnique(CPPPATH = ['../../include'])
ResourceClient_env.AppendUnique(CPPPATH = ['../../src/resourceBroker/include'])
ResourceClient_env.AppendUnique(CPPPATH = ['../../src/resourceCache/include'])
ResourceClient_env.AppendUnique(CPPPATH = ['../../src/common/primitiveResource/include'])
-ResourceClient_env.AppendUnique(CPPPATH = ['../../include'])
+
######################################################################
ResourceServer_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
ResourceServer_env.AppendUnique(LIBS = ['libserver_builder', 'libservice_common','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'pthread'])
+ResourceServer_env.AppendUnique(CPPPATH = ['../../include'])
ResourceServer_env.AppendUnique(CPPPATH = ['../../src/common/primitiveResource/include'])
ResourceServer_env.AppendUnique(CPPPATH = ['../../src/serverBuilder/include'])
try
{
- uri = OC_MULTICAST_DISCOVERY_URI + uri + "?rt=" + rt;
+ uri = OC_RSRVD_WELL_KNOWN_URI + uri + "?rt=" + rt;
//discover the resource in the network
discoveryManagerInstance->discoverResource(address, uri , CT_DEFAULT, &OnResourceDiscovered);
}
}
//hander for get request (if developer choose second option for resource Creation)
-PrimitiveGetResponse RequestHandlerForGet(const PrimitiveRequest &request,
+RCSGetResponse RequestHandlerForGet(const RCSRequest &request,
ResourceAttributes &attrs)
{
cout << "Recieved a Get request from Client" << std::endl;
std::cout << "\tkey : " << iter->key() << "\n\tvalue : " << iter->value().toString() << std::endl;
++iter;
}
- return PrimitiveGetResponse::create(attr);
+ return RCSGetResponse::create(attr);
}
//hander for set request (if developer choose second option for resource Creation)
-PrimitiveSetResponse RequestHandlerForSet(const PrimitiveRequest &request,
+RCSSetResponse RequestHandlerForSet(const RCSRequest &request,
ResourceAttributes &attrs)
{
cout << "Recieved a Set request from Client" << std::endl;
std::cout << "\tkey : " << iter->key() << "\n\tvalue : " << iter->value().toString() << std::endl;
++iter;
}
- return PrimitiveSetResponse::create(attrs);
+ return RCSSetResponse::create(attrs);
}
int main(void)
#include<vector>
#include "ResourceAttributes.h"
+#include "PrimitiveResource.h"
namespace OIC
{
/*
* Forward Declaration of Classes
*/
- class PrimitiveResource;
+ class RCSException;
class RemoteResourceObject;
/**
* This class inherited from PrimitiveException class.
*
*/
- class BadRequestException: public PrimitiveException
+ class BadRequestException: public RCSException
{
public:
- BadRequestException(const std::string &what) : PrimitiveException { what } {}
- BadRequestException(std::string &&what) : PrimitiveException { std::move(what) } {}
+ BadRequestException(const std::string &what) : RCSException{ what } {}
+ BadRequestException(std::string &&what) : RCSException{ std::move(what) } {}
};
/**
* @brief It is used to throw exception to the upper layer if parameter is invalid.
* This class inherited from PrimitiveException class.
*/
- class InvalidParameterException: public PrimitiveException
+ class InvalidParameterException: public RCSException
{
public:
- InvalidParameterException(const std::string &what) : PrimitiveException { what } {}
- InvalidParameterException(std::string &&what) : PrimitiveException { std::move(what) } {}
+ InvalidParameterException(const std::string &what) : RCSException{ what } {}
+ InvalidParameterException(std::string &&what) : RCSException{ std::move(what) } {}
};
/**