1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef OC_I_CLIENT_WRAPPER_H_
22 #define OC_I_CLIENT_WRAPPER_H_
31 class OCPlatform_impl;
33 class IClientWrapper : public std::enable_shared_from_this<IClientWrapper>
38 typedef std::shared_ptr<IClientWrapper> Ptr;
43 virtual OCStackResult ListenForResource(const std::string& serviceUrl,
44 const std::string& resourceType,
45 OCConnectivityType connectivityType,
46 FindCallback& callback,
47 QualityOfService QoS) = 0;
49 virtual OCStackResult ListenErrorForResource(const std::string& serviceUrl,
50 const std::string& resourceType,
51 OCConnectivityType connectivityType,
52 FindCallback& callback,
53 FindErrorCallback& errorCallback,
54 QualityOfService QoS) = 0;
56 virtual OCStackResult ListenForDevice(const std::string& serviceUrl,
57 const std::string& deviceURI,
58 OCConnectivityType connectivityType,
59 FindDeviceCallback& callback,
60 QualityOfService QoS) = 0;
62 virtual OCStackResult GetResourceRepresentation(
63 const OCDevAddr& devAddr,
64 const std::string& uri,
65 const QueryParamsMap& queryParams,
66 const HeaderOptions& headerOptions,
67 GetCallback& callback, QualityOfService QoS)=0;
69 virtual OCStackResult PutResourceRepresentation(
70 const OCDevAddr& devAddr,
71 const std::string& uri,
72 const OCRepresentation& rep, const QueryParamsMap& queryParams,
73 const HeaderOptions& headerOptions,
74 PutCallback& callback, QualityOfService QoS) = 0;
76 virtual OCStackResult PostResourceRepresentation(
77 const OCDevAddr& devAddr,
78 const std::string& uri,
79 const OCRepresentation& rep, const QueryParamsMap& queryParams,
80 const HeaderOptions& headerOptions,
81 PostCallback& callback, QualityOfService QoS) = 0;
83 virtual OCStackResult DeleteResource(
84 const OCDevAddr& devAddr,
85 const std::string& uri,
86 const HeaderOptions& headerOptions,
87 DeleteCallback& callback, QualityOfService QoS) = 0;
89 virtual OCStackResult ObserveResource(
90 ObserveType observeType, OCDoHandle* handle,
91 const OCDevAddr& devAddr,
92 const std::string& uri,
93 const QueryParamsMap& queryParams,
94 const HeaderOptions& headerOptions, ObserveCallback& callback,
95 QualityOfService QoS)=0;
97 virtual OCStackResult CancelObserveResource(
99 const std::string& host,
100 const std::string& uri,
101 const HeaderOptions& headerOptions,
102 QualityOfService QoS)=0;
104 virtual OCStackResult SubscribePresence(OCDoHandle* handle,
105 const std::string& host,
106 const std::string& resourceType,
107 OCConnectivityType connectivityType,
108 SubscribeCallback& presenceHandler)=0;
110 virtual OCStackResult UnsubscribePresence(OCDoHandle handle) =0;
112 virtual OCStackResult GetDefaultQos(QualityOfService& qos) = 0;
114 virtual ~IClientWrapper(){}