replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / include / pinoxmcommon.h
index 52e411f..5b75684 100644 (file)
@@ -59,6 +59,11 @@ typedef void (*GeneratePinCallback)(char* pinData, size_t pinSize);
 typedef void (*InputPinCallback)(char* pinBuf, size_t bufSize);
 
 /**
+ * Function pointer to close the displied PIN.
+ */
+typedef void (*ClosePinDisplayCallback)(void);
+
+/**
  * Function to setting generate PIN callback from user.
  *
  * @param pinCB implementation of generate PIN callback.
@@ -73,6 +78,14 @@ void SetGeneratePinCB(GeneratePinCallback pinCB);
 void SetInputPinCB(InputPinCallback pinCB);
 
 /**
+ * Function to set the close PIN callback
+ * This callback will be invoked when PIN based OTM is finished.
+ *
+ * @param closeCB implementation of close PIN callback.
+ */
+void SetClosePinDisplayCB(ClosePinDisplayCallback closeCB);
+
+/**
  * Function to unset the input PIN callback.
  * NOTE : Do not call this function while PIN based ownership transfer.
  */
@@ -85,6 +98,12 @@ void UnsetInputPinCB();
 void UnsetGeneratePinCB();
 
 /**
+ * Function to unset the PIN close callback.
+ * NOTE : Do not call this function while PIN based ownership transfer is in progress.
+ */
+void UnsetClosePinCB();
+
+/**
  * Function to generate random PIN.
  * This function will send generated PIN to user via callback.
  *
@@ -105,7 +124,13 @@ OCStackResult GeneratePin(char* pinBuffer, size_t bufferSize);
  */
 OCStackResult InputPin(char* pinBuffer, size_t bufferSize);
 
-#ifdef _ENABLE_MULTIPLE_OWNER_
+/**
+ * Function to invoke the callback for close a PIN dispaly.
+ * NOTE : This function will be invoked from SRM while OTM
+ */
+void ClosePinDisplay();
+
+#ifdef MULTIPLE_OWNER
 /**
  * Function to save the Pre-configured PIN.
  *
@@ -153,7 +178,7 @@ int32_t GetDtlsPskForRandomPinOxm( CADtlsPskCredType_t type,
               const unsigned char *UNUSED1, size_t UNUSED2,
               unsigned char *result, size_t result_length);
 
-#ifdef _ENABLE_MULTIPLE_OWNER_
+#ifdef MULTIPLE_OWNER
 /**
  * This internal callback is used while Random PIN based MOT.
  * This callback will be used to establish a temporary secure session according to
@@ -210,8 +235,7 @@ int32_t GetDtlsPskForMotPreconfPinOxm( CADtlsPskCredType_t type,
               const unsigned char *UNUSED1, size_t UNUSED2,
               unsigned char *result, size_t result_length);
 
-#endif //_ENABLE_MULTIPLE_OWNER_
-
+#endif //MULTIPLE_OWNER
 
 /**
  * API to derive the PSK based on PIN and new device's UUID.