+ SetGeneratePinCB(GeneratePinCB);
+
+ /**
+ * If ther server supports random pin based OTM,
+ * the callback to close PIN display can be registered.
+ * This callback will be invoked when random PIN based OTM is done.
+ */
+ SetClosePinDisplayCB(ClosePinDisplayCB);
+
+ /**
+ * Random PIN generation policy can be changed through SetRandomPinPolicy() API.
+ * first param : byte length of random PIN ( 4 <= first param <= 32)
+ * second param : PIN type (This is bitmask)
+ */
+ if(OC_STACK_OK != SetRandomPinPolicy(8, NUM_PIN))
+ {
+ OIC_LOG(ERROR, TAG, "Failed to setting PIN policy");
+ return 0;
+ }