Active Discovery Resource Type Filtering - C SDK & App Changes only.
[platform/upstream/iotivity.git] / resource / csdk / stack / include / ocstack.h
index a40f056..c6f5357 100644 (file)
@@ -37,6 +37,7 @@ extern "C" {
 #define OC_WELL_KNOWN_QUERY                  "coap://224.0.1.187:5683/oc/core"
 #define OC_EXPLICIT_DEVICE_DISCOVERY_URI     "coap://224.0.1.187:5683/oc/core?rt=core.led"
 #define OC_MULTICAST_PREFIX                  "coap://224.0.1.187:5683"
+#define OC_MULTICAST_IP                      "coap://224.0.1.187"
 
 #define USE_RANDOM_PORT (0)
 #ifdef WITH_PRESENCE
@@ -391,6 +392,8 @@ OCStackResult OCProcess();
  *     OC_STACK_INVALID_CALLBACK - invalid callback function pointer
  *     OC_STACK_INVALID_METHOD   - invalid resource method
  *     OC_STACK_INVALID_URI      - invalid required or reference URI
+ *     OC_STACK_INVALID_QUERY    - number of resource types specified for filtering presence
+ *                                 notifications exceeds @ref MAX_PRESENCE_FILTERS.
  */
 OCStackResult OCDoResource(OCDoHandle *handle, OCMethod method, const char  *requiredUri, const char  *referenceUri,
                 const char *request, OCQualityOfService qos, OCCallbackData *cbData, OCHeaderOption * options,
@@ -481,6 +484,32 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
                                uint8_t resourceProperties);
 
 /**
+ * Create a resource. with host ip address for remote resource
+ *
+ * @param handle - pointer to handle to newly created resource.  Set by ocstack.
+ *                 Used to refer to resource
+ * @param resourceTypeName - name of resource type.  Example: "core.led"
+ * @param resourceInterfaceName - name of resource interface.  Example: "core.rw"
+ * @param host - HOST address of the remote resource.  Example:  "coap://xxx.xxx.xxx.xxx:xxxxx"
+ * @param uri - URI of the resource.  Example:  "/a/led"
+ * @param entityHandler - entity handler function that is called by ocstack to handle requests, etc
+ *                        NULL for default entity handler
+ * @param resourceProperties - properties supported by resource.
+ *                             Example: OC_DISCOVERABLE|OC_OBSERVABLE
+ *
+ * @return
+ *     OC_STACK_OK    - no errors
+ *     OC_STACK_ERROR - stack process error
+ */
+OCStackResult OCCreateResourceWithHost(OCResourceHandle *handle,
+                               const char *resourceTypeName,
+                               const char *resourceInterfaceName,
+                               const char *host,
+                               const char *uri,
+                               OCEntityHandler entityHandler,
+                               uint8_t resourceProperties);
+
+/**
  * Add a resource to a collection resource.
  *
  * @param collectionHandle - handle to the collection resource