Simulated product dispenser

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2minterfaceobserver.h Source File

m2minterfaceobserver.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_INTERFACE_OBSERVER_H
00017 #define M2M_INTERFACE_OBSERVER_H
00018 
00019 #include "mbed-client/m2mbase.h"
00020 #include "mbed-client/m2minterface.h"
00021 
00022 //FORWARD DECLARATION
00023 class M2MServer;
00024 
00025 /*! \file m2minterfaceobserver.h
00026  * \brief M2MInterfaceObserver
00027  * This is an observer class that updates the calling application about
00028  * various events associated with various Interface operations.
00029  * Also, it informs about various errors that can occur during any of the above
00030  * operations.
00031  */
00032 class M2MInterfaceObserver {
00033 
00034 public:
00035 
00036     /**
00037      * \brief A callback indicating that the bootstap has been performed successfully.
00038      * \param server_object The server object that contains information fetched
00039      * about the LWM2M server from the bootstrap server. This object can be used
00040      * to register to the LWM2M server. The object ownership is passed.
00041      */
00042     virtual void bootstrap_done(M2MSecurity *server_object) = 0;
00043 
00044     /**
00045      * \brief A callback indicating that the device object has been registered
00046      * successfully to the LWM2M server.
00047      * \param security_object The server object on which the device object is
00048      * registered. The object ownership is passed.
00049      * \param server_object An object containing information about the LWM2M server.
00050      * The client maintains the object.
00051      */
00052     virtual void object_registered(M2MSecurity *security_object, const M2MServer &server_object) = 0;
00053 
00054     /**
00055      * \brief A callback indicating that the device object has been successfully unregistered
00056      * from the LWM2M server.
00057      * \param server_object The server object from which the device object is
00058      * unregistered. The object ownership is passed.
00059      */
00060     virtual void object_unregistered(M2MSecurity *server_object) = 0;
00061 
00062     /**
00063      * \brief A callback indicating that the device object registration has been successfully
00064      * updated on the LWM2M server.
00065      * \param security_object The server object on which the device object registration
00066      * updated. The object ownership is passed.
00067      * \param server_object An object containing information about the LWM2M server.
00068      * The client maintains the object.
00069      */
00070     virtual void registration_updated(M2MSecurity *security_object, const M2MServer & server_object) = 0;
00071 
00072     /**
00073      * \brief A callback indicating that there was an error during the operation.
00074      * \param error An error code for the occurred error.
00075      */
00076     virtual void error(M2MInterface::Error error) = 0;
00077 
00078     /**
00079      * \brief A callback indicating that the value of the resource object is updated by the server.
00080      * \param base The object whose value is updated.
00081      * \param type The type of the object.
00082      */
00083     virtual void value_updated(M2MBase *base, M2MBase::BaseType type) = 0;
00084 
00085     /**
00086      * \brief A callback indicating when all bootstrap data has been received.
00087      * \param security_object, The security object that contains the security information.
00088      */
00089     virtual void bootstrap_data_ready(M2MSecurity *security_object) { };
00090 
00091 };
00092 
00093 #endif // M2M_INTERFACE_OBSERVER_H