NOT_ALLOWED_OXM};
#endif
-static OTMSelectMethodCallback g_selectOTMCB = NULL;
+static OicSecOxm_t selectOTMcb_default(const OicSecOxm_t* otmList, const uint32_t len);
+static OTMSelectMethodCallback g_selectOTMCB = selectOTMcb_default;
OCStackResult OTMSetOTCallback(OicSecOxm_t oxm, OTMCallbackData_t* callbacks)
{
}
}
+OicSecOxm_t selectOTMcb_default(const OicSecOxm_t* otmList, const uint32_t len)
+{
+ OIC_LOG(INFO, TAG, "IN selectOTMcb_default");
+ OicSecOxm_t ret = -1;
+ VERIFY_NON_NULL(TAG, otmList, ERROR);
+ VERIFY_SUCCESS(TAG, (len > 0), ERROR);
+
+ ret = otmList[len-1];
+
+ for (size_t i = 0; i < len; i++)
+ {
+ if (OIC_RANDOM_DEVICE_PIN == otmList[i])
+ {
+ ret = OIC_RANDOM_DEVICE_PIN;
+ break;
+ }
+ }
+
+exit:
+ OIC_LOG(INFO, TAG, "OUT selectOTMcb_default");
+ return ret;
+}
+
/**
* Function to select appropriate provisioning method.
*