mbed client lightswitch demo
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client/mbed-client/m2minterfaceobserver.h@11:cada08fc8a70, 2016-06-09 (annotated)
- Committer:
- mbedAustin
- Date:
- Thu Jun 09 17:08:36 2016 +0000
- Revision:
- 11:cada08fc8a70
Commit for public Consumption
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbedAustin | 11:cada08fc8a70 | 1 | /* |
| mbedAustin | 11:cada08fc8a70 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
| mbedAustin | 11:cada08fc8a70 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| mbedAustin | 11:cada08fc8a70 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
| mbedAustin | 11:cada08fc8a70 | 5 | * not use this file except in compliance with the License. |
| mbedAustin | 11:cada08fc8a70 | 6 | * You may obtain a copy of the License at |
| mbedAustin | 11:cada08fc8a70 | 7 | * |
| mbedAustin | 11:cada08fc8a70 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| mbedAustin | 11:cada08fc8a70 | 9 | * |
| mbedAustin | 11:cada08fc8a70 | 10 | * Unless required by applicable law or agreed to in writing, software |
| mbedAustin | 11:cada08fc8a70 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
| mbedAustin | 11:cada08fc8a70 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| mbedAustin | 11:cada08fc8a70 | 13 | * See the License for the specific language governing permissions and |
| mbedAustin | 11:cada08fc8a70 | 14 | * limitations under the License. |
| mbedAustin | 11:cada08fc8a70 | 15 | */ |
| mbedAustin | 11:cada08fc8a70 | 16 | #ifndef M2M_INTERFACE_OBSERVER_H |
| mbedAustin | 11:cada08fc8a70 | 17 | #define M2M_INTERFACE_OBSERVER_H |
| mbedAustin | 11:cada08fc8a70 | 18 | |
| mbedAustin | 11:cada08fc8a70 | 19 | #include "mbed-client/m2mbase.h" |
| mbedAustin | 11:cada08fc8a70 | 20 | #include "mbed-client/m2minterface.h" |
| mbedAustin | 11:cada08fc8a70 | 21 | |
| mbedAustin | 11:cada08fc8a70 | 22 | //FORWARD DECLARATION |
| mbedAustin | 11:cada08fc8a70 | 23 | class M2MServer; |
| mbedAustin | 11:cada08fc8a70 | 24 | |
| mbedAustin | 11:cada08fc8a70 | 25 | /** |
| mbedAustin | 11:cada08fc8a70 | 26 | * @brief M2MInterfaceObserver |
| mbedAustin | 11:cada08fc8a70 | 27 | * This is an observer class that updates the calling application about |
| mbedAustin | 11:cada08fc8a70 | 28 | * various events associated with various Interface operations. |
| mbedAustin | 11:cada08fc8a70 | 29 | * Also, it informs about various errors that can occur during any of the above |
| mbedAustin | 11:cada08fc8a70 | 30 | * operations. |
| mbedAustin | 11:cada08fc8a70 | 31 | */ |
| mbedAustin | 11:cada08fc8a70 | 32 | class M2MInterfaceObserver { |
| mbedAustin | 11:cada08fc8a70 | 33 | |
| mbedAustin | 11:cada08fc8a70 | 34 | public: |
| mbedAustin | 11:cada08fc8a70 | 35 | |
| mbedAustin | 11:cada08fc8a70 | 36 | /** |
| mbedAustin | 11:cada08fc8a70 | 37 | * @brief Callback indicating that the bootstap has been done successfully. |
| mbedAustin | 11:cada08fc8a70 | 38 | * @param server_object Server object that contains information fetched |
| mbedAustin | 11:cada08fc8a70 | 39 | * about the LWM2M server from the bootstrap server. This object can be used |
| mbedAustin | 11:cada08fc8a70 | 40 | * to register to the LWM2M server. The object ownership is passed. |
| mbedAustin | 11:cada08fc8a70 | 41 | */ |
| mbedAustin | 11:cada08fc8a70 | 42 | virtual void bootstrap_done(M2MSecurity *server_object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 43 | |
| mbedAustin | 11:cada08fc8a70 | 44 | /** |
| mbedAustin | 11:cada08fc8a70 | 45 | * @brief Callback indicating that the device object has been registered |
| mbedAustin | 11:cada08fc8a70 | 46 | * successfully to the LWM2M server. |
| mbedAustin | 11:cada08fc8a70 | 47 | * @param security_object Server object on which the device object is |
| mbedAustin | 11:cada08fc8a70 | 48 | * registered. The object ownership is passed. |
| mbedAustin | 11:cada08fc8a70 | 49 | * @param server_object, Object containing information about the LWM2M server. |
| mbedAustin | 11:cada08fc8a70 | 50 | * The client maintains the object. |
| mbedAustin | 11:cada08fc8a70 | 51 | */ |
| mbedAustin | 11:cada08fc8a70 | 52 | virtual void object_registered(M2MSecurity *security_object, const M2MServer &server_object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 53 | |
| mbedAustin | 11:cada08fc8a70 | 54 | /** |
| mbedAustin | 11:cada08fc8a70 | 55 | * @brief Callback indicating that the device object has been successfully unregistered |
| mbedAustin | 11:cada08fc8a70 | 56 | * from the LWM2M server. |
| mbedAustin | 11:cada08fc8a70 | 57 | * @param server_object Server object from which the device object is |
| mbedAustin | 11:cada08fc8a70 | 58 | * unregistered. The object ownership is passed. |
| mbedAustin | 11:cada08fc8a70 | 59 | */ |
| mbedAustin | 11:cada08fc8a70 | 60 | virtual void object_unregistered(M2MSecurity *server_object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 61 | |
| mbedAustin | 11:cada08fc8a70 | 62 | /** |
| mbedAustin | 11:cada08fc8a70 | 63 | * @brief Callback indicating that the device object registration has been successfully |
| mbedAustin | 11:cada08fc8a70 | 64 | * updated on the LWM2M server. |
| mbedAustin | 11:cada08fc8a70 | 65 | * @param security_object Server object on which the device object registration |
| mbedAustin | 11:cada08fc8a70 | 66 | * updated. The object ownership is passed. |
| mbedAustin | 11:cada08fc8a70 | 67 | * @param server_object, Object containing information about the LWM2M server. |
| mbedAustin | 11:cada08fc8a70 | 68 | * The client maintains the object. |
| mbedAustin | 11:cada08fc8a70 | 69 | */ |
| mbedAustin | 11:cada08fc8a70 | 70 | virtual void registration_updated(M2MSecurity *security_object, const M2MServer & server_object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 71 | |
| mbedAustin | 11:cada08fc8a70 | 72 | /** |
| mbedAustin | 11:cada08fc8a70 | 73 | * @brief Callback indicating that there is an error during the operation. |
| mbedAustin | 11:cada08fc8a70 | 74 | * @param error Error code informing about the error that occured. |
| mbedAustin | 11:cada08fc8a70 | 75 | */ |
| mbedAustin | 11:cada08fc8a70 | 76 | virtual void error(M2MInterface::Error error) = 0; |
| mbedAustin | 11:cada08fc8a70 | 77 | |
| mbedAustin | 11:cada08fc8a70 | 78 | /** |
| mbedAustin | 11:cada08fc8a70 | 79 | * @brief Callback indicating that the value of the resource object is updated by the server. |
| mbedAustin | 11:cada08fc8a70 | 80 | * @param base Object whose value is updated. |
| mbedAustin | 11:cada08fc8a70 | 81 | * @param type Type of object. |
| mbedAustin | 11:cada08fc8a70 | 82 | */ |
| mbedAustin | 11:cada08fc8a70 | 83 | virtual void value_updated(M2MBase *base, M2MBase::BaseType type) = 0; |
| mbedAustin | 11:cada08fc8a70 | 84 | }; |
| mbedAustin | 11:cada08fc8a70 | 85 | |
| mbedAustin | 11:cada08fc8a70 | 86 | #endif // M2M_INTERFACE_OBSERVER_H |
Austin Blackstone
