mbed client on ethernet with LWIP
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client/source/include/m2mnsdlobserver.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_NSDL_OBSERVER_H |
mbedAustin | 11:cada08fc8a70 | 17 | #define M2M_NSDL_OBSERVER_H |
mbedAustin | 11:cada08fc8a70 | 18 | |
mbedAustin | 11:cada08fc8a70 | 19 | #include "include/nsdllinker.h" |
mbedAustin | 11:cada08fc8a70 | 20 | |
mbedAustin | 11:cada08fc8a70 | 21 | //FORWARD DECLARATION |
mbedAustin | 11:cada08fc8a70 | 22 | class M2MSecurity; |
mbedAustin | 11:cada08fc8a70 | 23 | class M2MServer; |
mbedAustin | 11:cada08fc8a70 | 24 | |
mbedAustin | 11:cada08fc8a70 | 25 | /** |
mbedAustin | 11:cada08fc8a70 | 26 | * @brief Observer class for informing NSDL callback to the state machine |
mbedAustin | 11:cada08fc8a70 | 27 | */ |
mbedAustin | 11:cada08fc8a70 | 28 | |
mbedAustin | 11:cada08fc8a70 | 29 | class M2MNsdlObserver |
mbedAustin | 11:cada08fc8a70 | 30 | { |
mbedAustin | 11:cada08fc8a70 | 31 | |
mbedAustin | 11:cada08fc8a70 | 32 | public : |
mbedAustin | 11:cada08fc8a70 | 33 | |
mbedAustin | 11:cada08fc8a70 | 34 | /** |
mbedAustin | 11:cada08fc8a70 | 35 | * @brief Informs that coap message is ready. |
mbedAustin | 11:cada08fc8a70 | 36 | * @param data_ptr, Data object of coap message. |
mbedAustin | 11:cada08fc8a70 | 37 | * @param data_len, Length of the data object. |
mbedAustin | 11:cada08fc8a70 | 38 | * @param address_ptr, Address structure of the server. |
mbedAustin | 11:cada08fc8a70 | 39 | */ |
mbedAustin | 11:cada08fc8a70 | 40 | virtual void coap_message_ready(uint8_t *data_ptr, |
mbedAustin | 11:cada08fc8a70 | 41 | uint16_t data_len, |
mbedAustin | 11:cada08fc8a70 | 42 | sn_nsdl_addr_s *address_ptr) = 0; |
mbedAustin | 11:cada08fc8a70 | 43 | |
mbedAustin | 11:cada08fc8a70 | 44 | /** |
mbedAustin | 11:cada08fc8a70 | 45 | * @brief Informs that client is registered successfully. |
mbedAustin | 11:cada08fc8a70 | 46 | * @param server_object, Server object associated with |
mbedAustin | 11:cada08fc8a70 | 47 | * registered server. |
mbedAustin | 11:cada08fc8a70 | 48 | */ |
mbedAustin | 11:cada08fc8a70 | 49 | virtual void client_registered(M2MServer *server_object) = 0; |
mbedAustin | 11:cada08fc8a70 | 50 | |
mbedAustin | 11:cada08fc8a70 | 51 | /** |
mbedAustin | 11:cada08fc8a70 | 52 | * @brief Informs that client registration is updated successfully. |
mbedAustin | 11:cada08fc8a70 | 53 | * @param server_object, Server object associated with |
mbedAustin | 11:cada08fc8a70 | 54 | * registered server. |
mbedAustin | 11:cada08fc8a70 | 55 | */ |
mbedAustin | 11:cada08fc8a70 | 56 | virtual void registration_updated(const M2MServer &server_object) = 0; |
mbedAustin | 11:cada08fc8a70 | 57 | |
mbedAustin | 11:cada08fc8a70 | 58 | /** |
mbedAustin | 11:cada08fc8a70 | 59 | * @brief Informs that some error occured during |
mbedAustin | 11:cada08fc8a70 | 60 | * registration. |
mbedAustin | 11:cada08fc8a70 | 61 | * @param error_code, Error code for registration error |
mbedAustin | 11:cada08fc8a70 | 62 | */ |
mbedAustin | 11:cada08fc8a70 | 63 | virtual void registration_error(uint8_t error_code) = 0; |
mbedAustin | 11:cada08fc8a70 | 64 | |
mbedAustin | 11:cada08fc8a70 | 65 | /** |
mbedAustin | 11:cada08fc8a70 | 66 | * @brief Informs that client is unregistered successfully. |
mbedAustin | 11:cada08fc8a70 | 67 | */ |
mbedAustin | 11:cada08fc8a70 | 68 | virtual void client_unregistered() = 0; |
mbedAustin | 11:cada08fc8a70 | 69 | |
mbedAustin | 11:cada08fc8a70 | 70 | /** |
mbedAustin | 11:cada08fc8a70 | 71 | * @brief Informs that client bootstrapping is done. |
mbedAustin | 11:cada08fc8a70 | 72 | * @param security_object, M2MSecurity Object which contains information about |
mbedAustin | 11:cada08fc8a70 | 73 | * LWM2M server fetched from bootstrap server. |
mbedAustin | 11:cada08fc8a70 | 74 | */ |
mbedAustin | 11:cada08fc8a70 | 75 | virtual void bootstrap_done(M2MSecurity *security_object) = 0; |
mbedAustin | 11:cada08fc8a70 | 76 | |
mbedAustin | 11:cada08fc8a70 | 77 | /** |
mbedAustin | 11:cada08fc8a70 | 78 | * @brief Informs that some error occured during |
mbedAustin | 11:cada08fc8a70 | 79 | * bootstrapping. |
mbedAustin | 11:cada08fc8a70 | 80 | */ |
mbedAustin | 11:cada08fc8a70 | 81 | virtual void bootstrap_error() = 0; |
mbedAustin | 11:cada08fc8a70 | 82 | |
mbedAustin | 11:cada08fc8a70 | 83 | /** |
mbedAustin | 11:cada08fc8a70 | 84 | * @brief Informs that received data has been processed. |
mbedAustin | 11:cada08fc8a70 | 85 | */ |
mbedAustin | 11:cada08fc8a70 | 86 | virtual void coap_data_processed() = 0; |
mbedAustin | 11:cada08fc8a70 | 87 | |
mbedAustin | 11:cada08fc8a70 | 88 | /** |
mbedAustin | 11:cada08fc8a70 | 89 | * @brief Callback informing that the value of the resource object is updated by server. |
mbedAustin | 11:cada08fc8a70 | 90 | * @param base Object whose value is updated. |
mbedAustin | 11:cada08fc8a70 | 91 | */ |
mbedAustin | 11:cada08fc8a70 | 92 | virtual void value_updated(M2MBase *base) = 0; |
mbedAustin | 11:cada08fc8a70 | 93 | }; |
mbedAustin | 11:cada08fc8a70 | 94 | #endif // M2M_NSDL_OBSERVER_H |