printf("Received OC_STACK_OK from server\n");
if(clientResponse->payload)
{
- printf("Response ===================> %s\n", clientResponse->payload);
+ printf("Response ===================> %p\n", clientResponse->payload);
}
}
else if(OC_STACK_RESOURCE_CHANGED == clientResponse->result)
static void inputPinCB(char* pin, size_t len)
{
- if(!pin || OXM_RANDOM_PIN_SIZE>=len)
+ if(!pin || OXM_RANDOM_PIN_MAX_SIZE>=len)
{
OIC_LOG(ERROR, TAG, "inputPinCB invalid parameters");
return;
printf(" > INPUT PIN: ");
for(int ret=0; 1!=ret; )
{
- ret = scanf("%8s", pin);
+ ret = scanf("%32s", pin);
for( ; 0x20<=getchar(); ); // for removing overflow garbages
// '0x20<=code' is character region
}
// for error checking, the return value saved and printed
g_doneCB = false;
-#ifdef _ENABLE_MULTIPLE_OWNER_
+#ifdef MULTIPLE_OWNER
OCProvisionDev_t* dev = NULL;
LL_FOREACH(g_motdev_list, dev)
{
if(OIC_PRECONFIG_PIN == dev->doxm->oxmSel)
{
//Pre-Configured PIN initialization
- if(OC_STACK_OK != OCAddPreconfigPIN(dev, "12341234", OXM_PRECONFIG_PIN_SIZE))
+ const char* testPreconfigPin = "12341234";
+ if(OC_STACK_OK != OCAddPreconfigPin(dev, testPreconfigPin, strlen(testPreconfigPin)))
{
printf("\n\n\n*** %60s ***\n", "WARNNING : Failed to save the pre-configured PIN");
printf("*** %60s ***\n\n\n", "WARNNING : You can't use the pre-configured PIN OxM for MOT");
}
}
}
-#endif //_ENABLE_MULTIPLE_OWNER_
+#endif //MULTIPLE_OWNER
if(OC_STACK_OK != OCDoMultipleOwnershipTransfer(g_ctx, g_motdev_list, multipleOwnershipTransferCB))
{
}
}
+ if(!g_doneCB)
+ {
+ OCPDMCleanupForTimeout();
+ }
+
return 0;
}