Simple interface for Mbed Cloud Client
Embed:
(wiki syntax)
Show/hide line numbers
m2mobservationhandler.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (c) 2015 ARM Limited. All rights reserved. 00003 * SPDX-License-Identifier: Apache-2.0 00004 * Licensed under the Apache License, Version 2.0 (the License); you may 00005 * not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT 00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #ifndef M2M_OBSERVATION_HANDLER_H 00017 #define M2M_OBSERVATION_HANDLER_H 00018 00019 //FORWARD DECLARATION 00020 class M2MBase; 00021 class M2MResourceInstance; 00022 00023 /*! \file m2mobservationhandler.h 00024 * \brief M2MObservationHandler. 00025 * An interface for handling observation 00026 * callbacks from different objects. 00027 * 00028 */ 00029 class M2MObservationHandler 00030 { 00031 public: 00032 00033 /** 00034 * \brief The observation callback to be sent to the 00035 * server due to a change in a parameter under observation. 00036 * \param object The observed object whose information needs to be sent. 00037 * \param obs_number The observation number. 00038 * \param changed_instance_ids A list of changed object instance IDs. 00039 * \param send_object Indicates whether the whole object will be sent or not. 00040 */ 00041 virtual void observation_to_be_sent(M2MBase *object, 00042 uint16_t obs_number, 00043 const m2m::Vector<uint16_t> &changed_instance_ids, 00044 bool send_object = false) = 0; 00045 00046 /** 00047 * \brief A callback for removing an NSDL resource from the data structures. 00048 * \param The M2MBase derived observed object whose information 00049 * needs to be removed. 00050 */ 00051 virtual void resource_to_be_deleted(M2MBase *base) = 0; 00052 00053 /** 00054 * \brief A callback indicating that the value of the resource object is updated by server. 00055 * \param base The object whose value is updated. 00056 * \param object_name The name of the updated resource, default is empty. 00057 */ 00058 virtual void value_updated(M2MBase *base) = 0; 00059 00060 /** 00061 * \brief A callback for removing an object from the list. 00062 * \param object The M2MObject to be removed. 00063 */ 00064 virtual void remove_object(M2MBase *object) = 0; 00065 00066 #ifndef DISABLE_DELAYED_RESPONSE 00067 /** 00068 * \brief A delayed response callback to be sent to the 00069 * server due to a changed response. 00070 * \param base The resource sending the response. 00071 */ 00072 virtual void send_delayed_response(M2MBase *base) = 0; 00073 #endif 00074 }; 00075 00076 00077 #endif // M2M_OBSERVATION_HANDLER_H
Generated on Tue Jul 12 2022 19:01:35 by 1.7.2