ThingsConfiguration class.
In the case that a callback pointer of the function is NULL,
a return value for the function call will be OC_STACK_ERROR
rather than OC_STACK_OK.
Reference issue ID : [IOT-196]
Change-Id: Ieb280bc6e5317496b96342a0374129c1e692b415
Signed-off-by: jihun.ha <jihun.ha@samsung.com>
break;
else if (g_Steps == 1)
{
- g_thingsmanager->doBootstrap(&onBootstrap);
- isWaiting = 1;
+ if( g_thingsmanager->doBootstrap(&onBootstrap) == OC_STACK_OK)
+ isWaiting = 1;
+ else
+ std::cout << "A callback pointer of the function is NULL." << std::endl;
}
else if (g_Steps == 2)
{
OCStackResult ThingsConfiguration::doBootstrap(ConfigurationCallback callback)
{
- g_bootstrapCallback = callback;
+ if(callback == NULL)
+ return OC_STACK_ERROR;
+ else
+ g_bootstrapCallback = callback;
// Find bootstrap server.
std::vector < std::string > type;