Mistake on this page? Email us
m2mobservationhandler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 ARM Limited. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  * Licensed under the Apache License, Version 2.0 (the License); you may
5  * not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef M2M_OBSERVATION_HANDLER_H
17 #define M2M_OBSERVATION_HANDLER_H
18 
19 // Needed for M2MBase::Operation
20 #include "m2mbase.h"
22 //FORWARD DECLARATION
24 
31 {
32  public:
33 
44  virtual bool observation_to_be_sent(M2MBase *object,
45  uint16_t obs_number,
46  const m2m::Vector<uint16_t> &changed_instance_ids,
47  bool send_object = false) = 0;
48 
54  virtual void resource_to_be_deleted(M2MBase *base) = 0;
55 
61  virtual void value_updated(M2MBase *base) = 0;
62 
67  virtual void remove_object(M2MBase *object) = 0;
68 
69 #ifndef DISABLE_DELAYED_RESPONSE
70 
75  virtual void send_delayed_response(M2MBase *base, sn_coap_msg_code_e code = COAP_MSG_CODE_RESPONSE_CHANGED) = 0;
76 #endif
77 
78 #ifdef ENABLE_ASYNC_REST_RESPONSE
79 
88  virtual void send_asynchronous_response(M2MBase *base,
89  const uint8_t *payload,
90  size_t payload_len,
91  const uint8_t* token,
92  const uint8_t token_len,
93  coap_response_code_e code) = 0;
94 #endif
95 };
96 
97 
98 #endif // M2M_OBSERVATION_HANDLER_H
Definition: m2mobservationhandler.h:30
virtual bool observation_to_be_sent(M2MBase *object, uint16_t obs_number, const m2m::Vector< uint16_t > &changed_instance_ids, bool send_object=false)=0
The observation callback to be sent to the server due to a change in a parameter under observation...
virtual void resource_to_be_deleted(M2MBase *base)=0
A callback for removing an NSDL resource from the data structures.
virtual void send_delayed_response(M2MBase *base, sn_coap_msg_code_e code=COAP_MSG_CODE_RESPONSE_CHANGED)=0
Sends a delayed post response to the server with &#39;COAP_MSG_CODE_RESPONSE_CHANGED&#39; response code...
Definition: m2mbase.h:54
virtual void remove_object(M2MBase *object)=0
A callback for removing an object from the list.
Header for M2MBase class.
CoAP response code values.
virtual void value_updated(M2MBase *base)=0
A callback indicating that the value of the resource object is updated by server. ...
Definition: m2mresourceinstance.h:38
A simple C++ Vector class, used as replacement for std::vector.
Definition: m2mvector.h:29
coap_response_code_e
Definition: coap_response.h:26