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>
(cherry picked from commit
f3344c1e09c42722c023a1ae3940496e2025a97d)
Reviewed-on: https://gerrit.iotivity.org/gerrit/165
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.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;