replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / csdk / security / provisioning / include / pmutility.h
old mode 100755 (executable)
new mode 100644 (file)
index d3947b1..f192d8c
@@ -38,21 +38,40 @@ extern "C"
 #define COAP_QUERY "coap://%s:%d%s"
 
 #define COAP_TCP_PREFIX "coap+tcp://"
+#define COAP_TCP_QUERY "coap+tcp://%s:%d%s"
 #define COAPS_TCP_PREFIX "coaps+tcp://"
+#define COAPS_TCP_QUERY "coaps+tcp://%s:%d%s"
 
 /**
- * Discover owned/unowned devices in the specified endpoint.
- * It will return when found one or more device even though timeout is not exceeded
+ * Discover owned/unowned device in the specified endpoint/deviceID.
+ * It will return the found device even though timeout is not exceeded.
  *
  * @param[in] waittime           Timeout in seconds
- * @param[in] host               address of target endpoint
- * @param[in] connType           connectivity type of endpoint
- * @param[out] ppDevicesList      List of OCProvisionDev_t
+ * @param[in] deviceID           deviceID of target device.
+ * @param[out] ppFoundDevice     OCProvisionDev_t of found device
+ *
+ * @return OC_STACK_OK on success otherwise error.\n
+ *         OC_STACK_INVALID_PARAM when deviceID is NULL or ppFoundDevice is not initailized.
+ */
+OCStackResult PMSingleDeviceDiscovery(unsigned short waittime, const OicUuid_t* deviceID,
+                                 OCProvisionDev_t **ppFoundDevice);
+
+/**
+ * Discover owned/unowned device in the specified endpoint/MAC address.
+ * It will return the found device even though timeout is not exceeded.
+ *
+ * @param[in] waittime           Timeout in seconds.
+ * @param[in] deviceID           deviceID of target device.
+ * @param[in] hostAddress       MAC address of target device.
+ * @param[in] connType       ConnectivityType for discovery.
+ * @param[out] ppFoundDevice     OCProvisionDev_t of found device.
  *
  * @return OC_STACK_OK on success otherwise error.
+ *         OC_STACK_INVALID_PARAM when deviceID is NULL or ppFoundDevice is not initailized.
  */
-OCStackResult PMSingleDeviceDiscovery(unsigned short waittime, const char* host,
-                                 OCConnectivityType connType, OCProvisionDev_t **ppDevicesList);
+OCStackResult PMSingleDeviceDiscoveryInUnicast(unsigned short waittime, const OicUuid_t* deviceID,
+                        const char* hostAddress, OCConnectivityType connType,
+                        OCProvisionDev_t **ppFoundDevice);
 
 /**
  * Discover owned/unowned devices in the same IP subnet. .
@@ -65,6 +84,19 @@ OCStackResult PMSingleDeviceDiscovery(unsigned short waittime, const char* host,
  */
 OCStackResult PMDeviceDiscovery(unsigned short waittime, bool isOwned, OCProvisionDev_t **ppList);
 
+#ifdef MULTIPLE_OWNER
+/**
+ * Discover multiple OTM enabled devices in the same IP subnet.
+ *
+ * @param[in] waittime      Timeout in seconds.
+ * @param[in] isMultipleOwned       bool flag for MOT enabled / multiple owned discovery
+ * @param[in] ppDevicesList        List of OCProvisionDev_t.
+ *
+ * @return OC_STACK_OK on success otherwise error.
+ */
+OCStackResult PMMultipleOwnerDeviceDiscovery(unsigned short waittime, bool isMultipleOwned, OCProvisionDev_t **ppDevicesList);
+#endif //MULTIPLE_OWNER
+
 /**
  * This function deletes list of provision target devices
  *