mbed client lightswitch demo
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client/mbed-client/m2mobservationhandler.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_OBSERVATION_HANDLER_H |
| mbedAustin | 11:cada08fc8a70 | 17 | #define M2M_OBSERVATION_HANDLER_H |
| mbedAustin | 11:cada08fc8a70 | 18 | |
| mbedAustin | 11:cada08fc8a70 | 19 | |
| mbedAustin | 11:cada08fc8a70 | 20 | //FORWARD DECLARATION |
| mbedAustin | 11:cada08fc8a70 | 21 | class M2MBase; |
| mbedAustin | 11:cada08fc8a70 | 22 | class M2MResourceInstance; |
| mbedAustin | 11:cada08fc8a70 | 23 | |
| mbedAustin | 11:cada08fc8a70 | 24 | /** |
| mbedAustin | 11:cada08fc8a70 | 25 | * @brief M2MObservationHandler |
| mbedAustin | 11:cada08fc8a70 | 26 | * An interface for handling observation |
| mbedAustin | 11:cada08fc8a70 | 27 | * callbacks from different objects. |
| mbedAustin | 11:cada08fc8a70 | 28 | * |
| mbedAustin | 11:cada08fc8a70 | 29 | */ |
| mbedAustin | 11:cada08fc8a70 | 30 | class M2MObservationHandler |
| mbedAustin | 11:cada08fc8a70 | 31 | { |
| mbedAustin | 11:cada08fc8a70 | 32 | public: |
| mbedAustin | 11:cada08fc8a70 | 33 | |
| mbedAustin | 11:cada08fc8a70 | 34 | /** |
| mbedAustin | 11:cada08fc8a70 | 35 | * @brief Observation callback to be sent to the |
| mbedAustin | 11:cada08fc8a70 | 36 | * server due to a change in a parameter under observation. |
| mbedAustin | 11:cada08fc8a70 | 37 | * @param object, Observed object whose information |
| mbedAustin | 11:cada08fc8a70 | 38 | * needs to be sent. |
| mbedAustin | 11:cada08fc8a70 | 39 | */ |
| mbedAustin | 11:cada08fc8a70 | 40 | virtual void observation_to_be_sent(M2MBase *object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 41 | |
| mbedAustin | 11:cada08fc8a70 | 42 | /** |
| mbedAustin | 11:cada08fc8a70 | 43 | * @brief Callback for deleting an NSDL resource. |
| mbedAustin | 11:cada08fc8a70 | 44 | * @param resource_name, Name of the observed object whose information |
| mbedAustin | 11:cada08fc8a70 | 45 | * needs to be deleted. |
| mbedAustin | 11:cada08fc8a70 | 46 | */ |
| mbedAustin | 11:cada08fc8a70 | 47 | virtual void resource_to_be_deleted(const String &resource_name) = 0; |
| mbedAustin | 11:cada08fc8a70 | 48 | |
| mbedAustin | 11:cada08fc8a70 | 49 | /** |
| mbedAustin | 11:cada08fc8a70 | 50 | * @brief Callback indicating that the value of the resource object is updated by server. |
| mbedAustin | 11:cada08fc8a70 | 51 | * @param base, Object whose value is updated. |
| mbedAustin | 11:cada08fc8a70 | 52 | * @param object_name, Name of the resource which is updated, default is empty. |
| mbedAustin | 11:cada08fc8a70 | 53 | */ |
| mbedAustin | 11:cada08fc8a70 | 54 | virtual void value_updated(M2MBase *base, const String &object_name = "") = 0; |
| mbedAustin | 11:cada08fc8a70 | 55 | |
| mbedAustin | 11:cada08fc8a70 | 56 | /** |
| mbedAustin | 11:cada08fc8a70 | 57 | * @brief Callback for removing an object from the list. |
| mbedAustin | 11:cada08fc8a70 | 58 | * @param object, M2MObject to be removed. |
| mbedAustin | 11:cada08fc8a70 | 59 | */ |
| mbedAustin | 11:cada08fc8a70 | 60 | virtual void remove_object(M2MBase *object) = 0; |
| mbedAustin | 11:cada08fc8a70 | 61 | |
| mbedAustin | 11:cada08fc8a70 | 62 | }; |
| mbedAustin | 11:cada08fc8a70 | 63 | |
| mbedAustin | 11:cada08fc8a70 | 64 | |
| mbedAustin | 11:cada08fc8a70 | 65 | #endif // M2M_OBSERVATION_HANDLER_H |
Austin Blackstone
