* as BTH etc.
* NOTE: OCStackResult is defined in ocstack.h.
*/
+#ifdef CA_INT
+ OCStackResult findResource(const std::string& host, const std::string& resourceURI,
+ OCConnectivityType connectivityType, FindCallback resourceHandler);
+ OCStackResult findResource(const std::string& host, const std::string& resourceURI,
+ OCConnectivityType connectivityType, FindCallback resourceHandler,
+ QualityOfService QoS);
+#else
OCStackResult findResource(const std::string& host, const std::string& resourceURI,
FindCallback resourceHandler);
OCStackResult findResource(const std::string& host, const std::string& resourceURI,
FindCallback resourceHandler, QualityOfService QoS);
+#endif
+ /**
+ * API for Device Discovery
+ *
+ * @param host - Host IP Address. If null or empty, Multicast is performed.
+ * @param resourceURI - Uri containing address to the virtual device in C Stack
+ * ("/oc/core/d")
+ *
+ * @param QualityOfService the quality of communication
+ *
+ */
+#ifdef CA_INT
+ OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+ OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler);
+ OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+ OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler,
+ QualityOfService QoS);
+#else
+ OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+ FindDeviceCallback deviceInfoHandler);
+ OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
+ FindDeviceCallback deviceInfoHandler, QualityOfService QoS);
+#endif
/**
* This API registers a resource with the server
const std::shared_ptr<OCResource> resource);
/**
+ * This API registers all the device specific information
+ *
+ * @param OCDeviceInfo - Structure containing all the device related information
+ *
+ * @return OCStackResult return value of the API. Returns OC_STACK_OK if success
+ *
+ * Note: OCDeviceInfo is defined in OCStack.h
+ */
+ OCStackResult registerDeviceInfo(const OCDeviceInfo deviceInfo);
+
+ /**
* Set default device entity handler
*
* @param entityHandler - entity handler to handle requests for
* request. It can be used to unsubscribe from these events in the future.
* It will be set upon successful return of this method.
* @param host - The IP address/addressable name of the server to subscribe to.
+ * @param resourceType - a resource type specified as a filter for subscription callbacks.
* @param presenceHandler - callback function that will receive notifications/subscription
* events
*
* @return OCStackResult - return value of the API. Returns OCSTACK_OK if success <br>
*/
+#ifdef CA_INT
+ OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+ OCConnectivityType connectivityType, SubscribeCallback presenceHandler);
OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+ const std::string& resourceType, OCConnectivityType connectivityType,
SubscribeCallback presenceHandler);
-
+#else
+ OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+ SubscribeCallback presenceHandler);
+ OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
+ const std::string& resourceType, SubscribeCallback presenceHandler);
+#endif
/**
* unsubscribes from a previously subscribed server's presence events. Note that
* you may for a short time still receive events from the server since it may take time
* @param interfaces - a collection of interfaces that the resource supports/implements
* @return OCResource::Ptr - a shared pointer to the new resource object
*/
+#ifdef CA_INT
+ OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
+ OCConnectivityType connectivityType, bool isObservable,
+ const std::vector<std::string>& resourceTypes,
+ const std::vector<std::string>& interfaces);
+#else
OCResource::Ptr constructResourceObject(const std::string& host, const std::string& uri,
bool isObservable, const std::vector<std::string>& resourceTypes,
const std::vector<std::string>& interfaces);
+#endif
+ /**
+ * Allows application entity handler to send response to an incoming request.
+ *
+ * @param pResponse - OCResourceResponse pointer that will permit to set values related
+ * to resource response. <br>
+ * @return OCStackResult - return value of the API. Returns OCSTACK_OK if success <br>
+ */
+ OCStackResult sendResponse(const std::shared_ptr<OCResourceResponse> pResponse);
private:
PlatformConfig m_cfg;
OCPlatform_impl(const PlatformConfig& config);
/**
- * Private function to initalize the platfrom
+ * Private function to initalize the platfrom
*/
void init(const PlatformConfig& config);
/**
- * Private constructor/operators to prevent copying
- * of this object
- */
+ * Private constructor/operators to prevent copying
+ * of this object
+ */
OCPlatform_impl(const OCPlatform_impl& other)= delete;
OCPlatform_impl& operator=(const OCPlatform_impl&) = delete;
OCPlatform_impl& operator=(const OCPlatform_impl&&) = delete;