Imported Upstream version 1.1.0
[platform/upstream/iotivity.git] / resource / include / OCPlatform.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 /**
22  * @file
23  *
24  * This file contains the declaration of classes and its members related to
25  * OCPlatform.
26  */
27
28 #ifndef OC_PLATFORM_H_
29 #define OC_PLATFORM_H_
30 #include <OCApi.h>
31 #include <OCPlatform_impl.h>
32 namespace OC
33 {
34     /**
35     * This namespace contains the main entrance/functionality of the product.
36     * It may be used with OC::OCPlatform::functionName.  To set a custom configuration,
37     * the implementer must make a call to OCPlatform::Configure before the first usage
38     * of a function in this namespace.
39     */
40     namespace OCPlatform
41     {
42         /**
43         * API for overwriting the default configuration of the OCPlatform object.
44         * @note Any calls made to this AFTER the first call to OCPlatform::Instance
45         * will have no affect
46         */
47         void Configure(const PlatformConfig& config);
48
49         // typedef for handle to cancel presence info with
50         typedef OCDoHandle OCPresenceHandle;
51
52         /**
53          * API for notifying base that resource's attributes have changed.
54          *
55          * @param resourceHandle resource handle of the resource
56          *
57          * @return Returns ::OC_STACK_OK if success.
58          * @note This API is for server side only.
59          * @note OCResourceHandle is defined in ocstack.h
60          * @note OCStackResult is defined in ocstack.h.
61          * @see notifyAllObservers(OCResourceHandle, QualityOfService)
62          */
63         OCStackResult notifyAllObservers(OCResourceHandle resourceHandle);
64
65         /**
66          * @overload
67          *
68          * @param resourceHandle resource handle of the resource
69          * @param QoS the quality of communication
70          * @see notifyAllObservers(OCResourceHandle)
71          */
72         OCStackResult notifyAllObservers(OCResourceHandle resourceHandle, QualityOfService QoS);
73
74         /**
75          * API for notifying only specific clients that resource's attributes have changed.
76          *
77          * @param resourceHandle resource handle of the resource
78          * @param observationIds std vector of observationIds. These set of ids are ones which
79          * which will be notified upon resource change.
80          * @param responsePtr OCResourceResponse pointer used by app to fill the response for this
81          * resource change.
82          *
83          * @return Returns ::OC_STACK_OK if success.
84          * @note This API is for server side only.
85          * @note OCResourceHandle is defined in ocstack.h.
86          * @note OCStackResult is defined in ocstack.h.
87          * @see notifyListOfObservers(OCResourceHandle, ObservationIds&, const std::shared_ptr<OCResourceResponse>, QualityOfService)
88          */
89         OCStackResult notifyListOfObservers(
90                     OCResourceHandle resourceHandle,
91                     ObservationIds& observationIds,
92                     const std::shared_ptr<OCResourceResponse> responsePtr);
93         /**
94          * @overload
95          *
96          * @param resourceHandle resource handle of the resource
97          * @param observationIds std vector of observationIds. These set of ids are ones which
98          * which will be notified upon resource change.
99          * @param responsePtr OCResourceResponse pointer used by app to fill the response for this
100          * resource change.
101          * @param QoS the quality of communication
102          * @see notifyListOfObservers(OCResourceHandle, ObservationIds&, const std::shared_ptr<OCResourceResponse>)
103          */
104         OCStackResult notifyListOfObservers(
105                     OCResourceHandle resourceHandle,
106                     ObservationIds& observationIds,
107                     const std::shared_ptr<OCResourceResponse> responsePtr,
108                     QualityOfService QoS);
109
110         /**
111          * API for Service and Resource Discovery.
112          * @note This API applies to client side only.
113          *
114          * @param host Host IP Address of a service to direct resource discovery query. If null or
115          *        empty, performs multicast resource discovery query
116          * @param resourceURI name of the resource. If null or empty, performs search for all
117          *       resource names
118          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
119          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
120          * @param resourceHandler Handles callbacks, success states and failure states.
121          *
122          *        Four modes of discovery defined as follows:
123          *        (NULL/Empty, NULL/Empty) - Performs ALL service discovery AND ALL resource
124          *           discovery.
125          *        (NULL/Empty, Not Empty) - Performs query for a filtered/scoped/particular
126          *                                   resource(s) from ALL services.
127          *        (Not Empty, NULL/Empty) - Performs ALL resource discovery on a particular service.
128          *        (Not Empty, Not Empty) - Performs query for a filtered/scoped/particular
129          *                                   resource(s)
130          *                                  from a particular service.
131          *
132          * @return Returns ::OC_STACK_OK if success.
133          * @note First parameter 'host' currently represents an IP address. This will change in
134          * future and will refer to endpoint interface so that we can refer to other transports such
135          * as BTH etc.
136          * @note OCStackResult is defined in ocstack.h.
137          * @see findResource(const std::string&, const std::string&, OCConnectivityType, FindCallback, QualityOfService)
138          */
139         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
140                     OCConnectivityType connectivityType, FindCallback resourceHandler);
141         /**
142          * @overload
143          *
144          * @param host Host IP Address of a service to direct resource discovery query. If null or
145          *        empty, performs multicast resource discovery query
146          * @param resourceURI name of the resource. If null or empty, performs search for all
147          *       resource names
148          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
149          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
150          * @param resourceHandler Handles callbacks, success states and failure states.
151          *
152          *        Four modes of discovery defined as follows:
153          *        (NULL/Empty, NULL/Empty) - Performs ALL service discovery AND ALL resource
154          *           discovery.
155          *        (NULL/Empty, Not Empty) - Performs query for a filtered/scoped/particular
156          *                                   resource(s) from ALL services.
157          *        (Not Empty, NULL/Empty) - Performs ALL resource discovery on a particular service.
158          *        (Not Empty, Not Empty) - Performs query for a filtered/scoped/particular
159          *                                   resource(s)
160          *                                  from a particular service.
161          * @param QoS QualityOfService the quality of communication
162          * @see findResource(const std::string&, const std::string&, OCConnectivityType, FindCallback)
163          */
164         OCStackResult findResource(const std::string& host, const std::string& resourceURI,
165                     OCConnectivityType connectivityType, FindCallback resourceHandler,
166                     QualityOfService QoS);
167
168         /**
169          * API for Device Discovery
170          *
171          *
172          * @param host Host IP Address. If null or empty, Multicast is performed.
173          * @param deviceURI Uri containing address to the virtual device in C Stack
174                                 ("/oic/d")
175          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
176          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
177          * @param deviceInfoHandler device discovery callback
178          *
179          * @return Returns ::OC_STACK_OK if success.
180          * @note OCStackResult is defined in ocstack.h.
181          * @see getDeviceInfo(const std::string&, const std::string&, OCConnectivityType, FindDeviceCallback, QualityOfService)
182          */
183         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
184                     OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler);
185         /**
186          * @overload
187          *
188          * @param host Host IP Address. If null or empty, Multicast is performed.
189          * @param deviceURI Uri containing address to the virtual device in C Stack
190                                 ("/oic/d")
191          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
192          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
193          * @param deviceInfoHandler device discovery callback
194          * @param QoS the quality of communication
195          * @see getDeviceInfo(const std::string&, const std::string&, OCConnectivityType, FindDeviceCallback)
196          */
197         OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI,
198                     OCConnectivityType connectivityType, FindDeviceCallback deviceInfoHandler,
199                     QualityOfService QoS);
200
201         /**
202          * API for Platform Discovery
203          *
204          *
205          * @param host Host IP Address. If null or empty, Multicast is performed.
206          * @param platformURI Uri containing address to the virtual platform in C Stack
207                                 ("/oic/p")
208          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
209          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
210          * @param platformInfoHandler platform discovery callback
211          *
212          * @return Returns ::OC_STACK_OK if success.
213          *
214          * @note OCStackResult is defined in ocstack.h.
215          * @see getPlatformInfo(const std::string&, const std::string&, OCConnectivityType, FindPlatformCallback, QualityOfService)
216          */
217         OCStackResult getPlatformInfo(const std::string& host, const std::string& platformURI,
218                     OCConnectivityType connectivityType, FindPlatformCallback platformInfoHandler);
219         /**
220          * @overload
221          *
222          * @param host Host IP Address. If null or empty, Multicast is performed.
223          * @param platformURI Uri containing address to the virtual platform in C Stack
224                                 ("/oic/p")
225          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
226          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
227          * @param platformInfoHandler platform discovery callback
228          * @param QoS the quality of communication
229          * @see getPlatformInfo(const std::string&, const std::string&, OCConnectivityType, FindPlatformCallback)
230          */
231         OCStackResult getPlatformInfo(const std::string& host, const std::string& platformURI,
232                     OCConnectivityType connectivityType, FindPlatformCallback platformInfoHandler,
233                     QualityOfService QoS);
234
235         /**
236         * This API registers a resource with the server
237         * @note This API applies to server side only.
238         *
239         * @param resourceHandle Upon successful registration, resourceHandle will be filled
240         * @param resourceURI The URI of the resource. Example: "a/light". See NOTE below
241         * @param resourceTypeName The resource type. Example: "light"
242         * @param resourceInterface The resource interface (whether it is collection etc).
243         * @param entityHandler entity handler callback.
244         * @param resourceProperty indicates the property of the resource. Defined in ocstack.h.
245         * setting resourceProperty as OC_DISCOVERABLE will allow Discovery of this resource
246         * setting resourceProperty as OC_OBSERVABLE will allow observation
247         * settings resourceProperty as OC_DISCOVERABLE | OC_OBSERVABLE will allow both discovery and
248         * observation
249         *
250         * @return Returns ::OC_STACK_OK if success.
251         * @note "a/light" is a relative URI.
252         * Above relative URI will be prepended (by core) with a host IP + namespace "oic"
253         * Therefore, fully qualified URI format would be //HostIP-Address/namespace/relativeURI"
254         * Example, a relative URI: 'a/light' will result in a fully qualified URI:
255         *   //192.168.1.1/oic/a/light"
256         * First parameter can take a relative URI and core will take care of preparing the fully
257         * qualified URI OR
258         * first parameter can take fully qualified URI and core will take that as is for further
259         * operations
260         * @note OCStackResult is defined in ocstack.h.
261         */
262         OCStackResult registerResource(OCResourceHandle& resourceHandle,
263                         std::string& resourceURI,
264                         const std::string& resourceTypeName,
265                         const std::string& resourceInterface,
266                         EntityHandler entityHandler,
267                         uint8_t resourceProperty);
268
269         /**
270          * This API registers a resource with the server
271          * @note This API applies to server & client side.
272          *
273          * @param resourceHandle Upon successful registration, resourceHandle will be filled
274          * @param resource The instance of OCResource that all data filled.
275          *
276          * @return Returns ::OC_STACK_OK if success.
277          * @note OCStackResult is defined in ocstack.h.
278          */
279         OCStackResult registerResource(OCResourceHandle& resourceHandle,
280                         const std::shared_ptr< OCResource > resource);
281
282         /**
283         * Register Device Info
284         *
285         * @param deviceInfo structure containing all the device specific information
286         * @return Returns ::OC_STACK_OK  if no errors and ::OC_STACK_ERROR in case of stack process error
287         */
288         OCStackResult registerDeviceInfo(const OCDeviceInfo deviceInfo);
289
290         /**
291         * Register Platform Info
292         *
293         * @param platformInfo structure containing all the platform specific information
294         * @return Returns ::OC_STACK_OK if no errors and ::OC_STACK_ERROR in case of stack process error
295         */
296         OCStackResult registerPlatformInfo(const OCPlatformInfo platformInfo);
297
298         /**
299         * Set default device entity handler
300         *
301         * @param entityHandler entity handler to handle requests for
302         *                      any undefined resources or default actions.
303         *                      if NULL is passed it removes the device default entity handler.
304         * @return Returns ::OC_STACK_OK  if no errors and ::OC_STACK_ERROR in case of stack process error
305         */
306         OCStackResult setDefaultDeviceEntityHandler(EntityHandler entityHandler);
307
308         /**
309         * This API unregisters a resource with the server
310         * @note This API applies to server side only.
311         *
312         * @param resourceHandle This is the resource handle which we need to unregister from the
313         * server
314         *
315         * @return Returns ::OC_STACK_OK if success.
316         * @note OCStackResult is defined in ocstack.h.
317         */
318         OCStackResult unregisterResource(const OCResourceHandle& resourceHandle);
319
320         /**
321         * Add a resource to a collection resource.
322         *
323         * @param collectionHandle handle to the collection resource
324         * @param resourceHandle handle to resource to be added to the collection resource
325         *
326         * @return Returns ::OC_STACK_OK if success.
327         * @note OCStackResult is defined in ocstack.h.
328         * @note bindResource must be used only after the both collection resource and
329         * resource to add under a collections are created and respective handles obtained
330         *
331         * @par Example:
332         * -# registerResource(homeResourceHandle, "a/home", "home", Link_Interface,
333         *   entityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
334         * -# registerResource(kitchenResourceHandle, "a/kitchen", "kitchen", Link_Interface,
335         *   entityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
336         * -# bindResource(homeResourceHandle, kitchenResourceHandle);
337         * @par
338         * At the end of Step 3, resource "a/home" will contain a reference to "a/kitchen".
339         */
340         OCStackResult bindResource(const OCResourceHandle collectionHandle,
341                 const OCResourceHandle resourceHandle);
342
343         /**
344         * Add multiple resources to a collection resource.
345         *
346         * @param collectionHandle handle to the collection resource
347         * @param addedResourceHandleList reference to list of resource handles to be added to the
348         *   collection resource
349         *
350         * @return Returns ::OC_STACK_OK if success.
351         * @note OCStackResult is defined in ocstack.h.
352         * @note bindResources must be used only after the both collection resource and
353         * list of resources to add under a collection are created and respective handles
354         * obtained.
355         *
356         * @par Example:
357         * -# registerResource(homeResourceHandle, "a/home", "home", Link_Interface,
358         *   homeEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
359         * -# registerResource(kitchenResourceHandle, "a/kitchen", "kitchen", Link_Interface,
360         *   kitchenEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
361         * -# registerResource(roomResourceHandle, "a/room", "room", Link_Interface,
362         *   roomEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
363         * -# std::vector<OCResourceHandle> rList; rList.push_back(kitchenResourceHandle);
364         *   rList.push_back(roomResourceHandle);
365         * -# bindResource(homeResourceHandle, rList);
366         * @par
367         * At the end of Step 5, resource "a/home" will contain a references to "a/kitchen" and
368         *   "a/room"
369         */
370         OCStackResult bindResources(const OCResourceHandle collectionHandle,
371                 const std::vector<OCResourceHandle>& addedResourceHandleList);
372
373         /**
374         * Unbind a resource from a collection resource.
375         *
376         * @param collectionHandle handle to the collection resource
377         * @param resourceHandle resource handle to be unbound from the collection resource
378         *
379         * @return Returns ::OC_STACK_OK if success.
380         * @note OCStackResult is defined in ocstack.h.
381         * @note unbindResource must be used only after the both collection resource and
382         * resource to unbind from a collection are created and respective handles obtained
383         *
384         * @par Example:
385         * -# registerResource(homeResourceHandle, "a/home", "home", Link_Interface,
386         *   entityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
387         * -# registerResource(kitchenResourceHandle, "a/kitchen", "kitchen", Link_Interface,
388         *   entityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
389         * -# bindResource(homeResourceHandle, kitchenResourceHandle);
390         * -# unbindResource(homeResourceHandle, kitchenResourceHandle);
391         * @par
392         * At the end of Step 4, resource "a/home" will no longer reference "a/kitchen".
393         */
394         OCStackResult unbindResource(const OCResourceHandle collectionHandle,
395                     const OCResourceHandle resourceHandle);
396
397         /**
398         * Unbind resources from a collection resource.
399         *
400         * @param collectionHandle handle to the collection resource
401         * @param resourceHandleList List of resource handles to be unbound from the collection
402         *   resource
403         *
404         * @return Returns ::OC_STACK_OK if success.
405         * @note OCStackResult is defined in ocstack.h.
406         * @note unbindResources must be used only after the both collection resource and
407         * list of resources resource to unbind from a collection are created and respective handles
408         *   obtained.
409         *
410         * @par Example:
411         * -# registerResource(homeResourceHandle, "a/home", "home", Link_Interface,
412         *   homeEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
413         * -# registerResource(kitchenResourceHandle, "a/kitchen", "kitchen", Link_Interface,
414         *   kitchenEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
415         * -# registerResource(roomResourceHandle, "a/room", "room", Link_Interface,
416         *   roomEntityHandler, OC_DISCOVERABLE | OC_OBSERVABLE);
417         * -# std::vector<OCResourceHandle> rList; rList.push_back(kitchenResourceHandle);
418         *   rList.push_back(roomResourceHandle);
419         * -# bindResource(homeResourceHandle, rList);
420         * -# unbindResources(homeResourceHandle, rList);
421         * @par
422         * At the end of Step 6, resource "a/home" will no longer reference to "a/kitchen" and
423         *   "a/room"
424         */
425         OCStackResult unbindResources(const OCResourceHandle collectionHandle,
426                         const std::vector<OCResourceHandle>& resourceHandleList);
427
428         /**
429         * Binds a type to a particular resource
430         * @param resourceHandle handle to the resource
431         * @param resourceTypeName new typename to bind to the resource
432         *
433         * @return Returns ::OC_STACK_OK if success.
434         */
435         OCStackResult bindTypeToResource(const OCResourceHandle& resourceHandle,
436                         const std::string& resourceTypeName);
437
438         /**
439         * Binds an interface to a particular resource
440         * @param resourceHandle handle to the resource
441         * @param resourceInterfaceName new interface  to bind to the resource
442         *
443         * @return Returns ::OC_STACK_OK if success.
444         */
445         OCStackResult bindInterfaceToResource(const OCResourceHandle& resourceHandle,
446                         const std::string& resourceInterfaceName);
447
448
449         /**
450         * Start Presence announcements.
451         *
452         * @param ttl time to live
453         * @par
454         * If ttl is '0', then the default stack value will be used (60 Seconds).
455         * If ttl is greater than OC_MAX_PRESENCE_TTL_SECONDS, then the ttl will be set to
456         * OC_MAX_PRESENCE_TTL_SECONDS.
457         * @par
458         * @return Returns ::OC_STACK_OK if success.
459         *
460         * Server can call this function when it comes online for the
461         * first time, or when it comes back online from offline mode,
462         * or when it re enters network.
463         *
464         */
465         OCStackResult startPresence(const unsigned int ttl);
466
467         /**
468         * Stop Presence announcements.
469         *
470         * @return Returns ::OC_STACK_OK if success.
471         *
472         * Server can call this function when it is terminating,
473         * going offline, or when going away from network.
474         *
475         */
476         OCStackResult stopPresence();
477
478         /**
479          * subscribes to a server's presence change events.  By making this subscription,
480          * every time a server adds/removes/alters a resource, starts or is intentionally
481          * stopped (potentially more to be added later).
482          *
483          * @param presenceHandle a handle object that can be used to identify this subscription
484          *               request.  It can be used to unsubscribe from these events in the future.
485          *               It will be set upon successful return of this method.
486          * @param host The IP address/addressable name of the server to subscribe to.
487          *               This should be in the format coap://address:port
488          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
489          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
490          * @param presenceHandler callback function that will receive notifications/subscription
491          *               events
492          *
493          * @return Returns ::OC_STACK_OK if success.
494          * @copydoc subscribePresence(OCPresenceHandle&, const std::string&, resourceType, OCConnectivityType, SubscribeCallback)
495          */
496         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
497                         OCConnectivityType connectivityType, SubscribeCallback presenceHandler);
498         /**
499          * @overload
500          *
501          * @param presenceHandle a handle object that can be used to identify this subscription
502          *               request.  It can be used to unsubscribe from these events in the future.
503          *               It will be set upon successful return of this method.
504          * @param host The IP address/addressable name of the server to subscribe to.
505          *               This should be in the format coap://address:port
506          * @param resourceType a resource type specified as a filter for subscription callbacks.
507          * @param connectivityType ::OCConnectivityType type of connectivity indicating the
508          *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
509          * @param presenceHandler callback function that will receive notifications/subscription
510          *               events
511          * @see subscribePresence(OCPresenceHandle&, const std::string&, OCConnectivityType, SubscribeCallback)
512          */
513         OCStackResult subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
514                         const std::string& resourceType, OCConnectivityType connectivityType,
515                         SubscribeCallback presenceHandler);
516
517         /**
518         * unsubscribes from a previously subscribed server's presence events. Note that
519         * you may for a short time still receive events from the server since it may take time
520         * for the unsubscribe to take effect.
521         *
522         * @param presenceHandle the handle object provided by the subscribePresence call that
523         *               identifies this subscription.
524         *
525         * @return Returns ::OC_STACK_OK if success.
526         */
527         OCStackResult unsubscribePresence(OCPresenceHandle presenceHandle);
528
529         /**
530         * Creates a resource proxy object so that get/put/observe functionality
531         * can be used without discovering the object in advance.  Note that the
532         * consumer of this method needs to provide all of the details required to
533         * correctly contact and observe the object. If the consumer lacks any of
534         * this information, they should discover the resource object normally.
535         * Additionally, you can only create this object if OCPlatform was initialized
536         * to be a Client or Client/Server.  Otherwise, this will return an empty
537         * shared ptr.
538         *
539         * @param host a string containing a resolvable host address of the server
540         *           holding the resource. Currently this should be in the format
541         *           coap://address:port, though in the future, we expect this to
542         *           change to //address:port
543         *
544         * @param uri the rest of the resource's URI that will permit messages to be
545         *           properly routed.  Example: /a/light
546         *
547         * @param connectivityType ::OCConnectivityType type of connectivity indicating the
548         *                           interface. Example: OC_WIFI, OC_ETHERNET, OC_ALL
549         *
550         * @param isObservable a boolean containing whether the resource supports observation
551         *
552         * @param resourceTypes a collection of resource types implemented by the resource
553         *
554         * @param interfaces a collection of interfaces that the resource supports/implements
555         * @return OCResource::Ptr a shared pointer to the new resource object
556         */
557         OCResource::Ptr constructResourceObject(const std::string& host,
558                         const std::string& uri,
559                         OCConnectivityType connectivityType, bool isObservable,
560                         const std::vector<std::string>& resourceTypes,
561                         const std::vector<std::string>& interfaces);
562
563         /**
564         * Allows application entity handler to send response to an incoming request.
565         *
566         * @param pResponse OCResourceResponse pointer that will permit to set values related
567         * to resource response.
568         *
569         * @return Returns ::OC_STACK_OK if success.
570         */
571         OCStackResult sendResponse(const std::shared_ptr<OCResourceResponse> pResponse);
572     }
573 }
574
575 #endif // OC_PLATFORM_H_
576
577
578