Ram Gandikota
/
ABCD
A metronome using the FRDM K64F board
mbed-client/source/include/m2mnsdlobserver.h@0:a7a43371b306, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:40:18 2017 +0000
- Revision:
- 0:a7a43371b306
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:a7a43371b306 | 1 | /* |
ram54288 | 0:a7a43371b306 | 2 | * Copyright (c) 2015 ARM Limited. All rights reserved. |
ram54288 | 0:a7a43371b306 | 3 | * SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:a7a43371b306 | 4 | * Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:a7a43371b306 | 5 | * not use this file except in compliance with the License. |
ram54288 | 0:a7a43371b306 | 6 | * You may obtain a copy of the License at |
ram54288 | 0:a7a43371b306 | 7 | * |
ram54288 | 0:a7a43371b306 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:a7a43371b306 | 9 | * |
ram54288 | 0:a7a43371b306 | 10 | * Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:a7a43371b306 | 11 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:a7a43371b306 | 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:a7a43371b306 | 13 | * See the License for the specific language governing permissions and |
ram54288 | 0:a7a43371b306 | 14 | * limitations under the License. |
ram54288 | 0:a7a43371b306 | 15 | */ |
ram54288 | 0:a7a43371b306 | 16 | #ifndef M2M_NSDL_OBSERVER_H |
ram54288 | 0:a7a43371b306 | 17 | #define M2M_NSDL_OBSERVER_H |
ram54288 | 0:a7a43371b306 | 18 | |
ram54288 | 0:a7a43371b306 | 19 | #include "include/nsdllinker.h" |
ram54288 | 0:a7a43371b306 | 20 | |
ram54288 | 0:a7a43371b306 | 21 | //FORWARD DECLARATION |
ram54288 | 0:a7a43371b306 | 22 | class M2MSecurity; |
ram54288 | 0:a7a43371b306 | 23 | class M2MServer; |
ram54288 | 0:a7a43371b306 | 24 | |
ram54288 | 0:a7a43371b306 | 25 | /** |
ram54288 | 0:a7a43371b306 | 26 | * @brief Observer class for informing NSDL callback to the state machine |
ram54288 | 0:a7a43371b306 | 27 | */ |
ram54288 | 0:a7a43371b306 | 28 | |
ram54288 | 0:a7a43371b306 | 29 | class M2MNsdlObserver |
ram54288 | 0:a7a43371b306 | 30 | { |
ram54288 | 0:a7a43371b306 | 31 | |
ram54288 | 0:a7a43371b306 | 32 | public : |
ram54288 | 0:a7a43371b306 | 33 | |
ram54288 | 0:a7a43371b306 | 34 | /** |
ram54288 | 0:a7a43371b306 | 35 | * @brief Informs that coap message is ready. |
ram54288 | 0:a7a43371b306 | 36 | * @param data_ptr, Data object of coap message. |
ram54288 | 0:a7a43371b306 | 37 | * @param data_len, Length of the data object. |
ram54288 | 0:a7a43371b306 | 38 | * @param address_ptr, Address structure of the server. |
ram54288 | 0:a7a43371b306 | 39 | */ |
ram54288 | 0:a7a43371b306 | 40 | virtual void coap_message_ready(uint8_t *data_ptr, |
ram54288 | 0:a7a43371b306 | 41 | uint16_t data_len, |
ram54288 | 0:a7a43371b306 | 42 | sn_nsdl_addr_s *address_ptr) = 0; |
ram54288 | 0:a7a43371b306 | 43 | |
ram54288 | 0:a7a43371b306 | 44 | /** |
ram54288 | 0:a7a43371b306 | 45 | * @brief Informs that client is registered successfully. |
ram54288 | 0:a7a43371b306 | 46 | * @param server_object, Server object associated with |
ram54288 | 0:a7a43371b306 | 47 | * registered server. |
ram54288 | 0:a7a43371b306 | 48 | */ |
ram54288 | 0:a7a43371b306 | 49 | virtual void client_registered(M2MServer *server_object) = 0; |
ram54288 | 0:a7a43371b306 | 50 | |
ram54288 | 0:a7a43371b306 | 51 | /** |
ram54288 | 0:a7a43371b306 | 52 | * @brief Informs that client registration is updated successfully. |
ram54288 | 0:a7a43371b306 | 53 | * @param server_object, Server object associated with |
ram54288 | 0:a7a43371b306 | 54 | * registered server. |
ram54288 | 0:a7a43371b306 | 55 | */ |
ram54288 | 0:a7a43371b306 | 56 | virtual void registration_updated(const M2MServer &server_object) = 0; |
ram54288 | 0:a7a43371b306 | 57 | |
ram54288 | 0:a7a43371b306 | 58 | /** |
ram54288 | 0:a7a43371b306 | 59 | * @brief Informs that some error occured during |
ram54288 | 0:a7a43371b306 | 60 | * registration. |
ram54288 | 0:a7a43371b306 | 61 | * @param error_code, Error code for registration error |
ram54288 | 0:a7a43371b306 | 62 | * @param retry, Indicates state machine to re-establish connection |
ram54288 | 0:a7a43371b306 | 63 | */ |
ram54288 | 0:a7a43371b306 | 64 | virtual void registration_error(uint8_t error_code, bool retry = false) = 0; |
ram54288 | 0:a7a43371b306 | 65 | |
ram54288 | 0:a7a43371b306 | 66 | /** |
ram54288 | 0:a7a43371b306 | 67 | * @brief Informs that client is unregistered successfully. |
ram54288 | 0:a7a43371b306 | 68 | */ |
ram54288 | 0:a7a43371b306 | 69 | virtual void client_unregistered() = 0; |
ram54288 | 0:a7a43371b306 | 70 | |
ram54288 | 0:a7a43371b306 | 71 | /** |
ram54288 | 0:a7a43371b306 | 72 | * @brief Informs that client bootstrapping is done. |
ram54288 | 0:a7a43371b306 | 73 | * @param security_object, M2MSecurity Object which contains information about |
ram54288 | 0:a7a43371b306 | 74 | * LWM2M server fetched from bootstrap server. |
ram54288 | 0:a7a43371b306 | 75 | */ |
ram54288 | 0:a7a43371b306 | 76 | virtual void bootstrap_done(M2MSecurity *security_object) = 0; |
ram54288 | 0:a7a43371b306 | 77 | |
ram54288 | 0:a7a43371b306 | 78 | /** |
ram54288 | 0:a7a43371b306 | 79 | * @brief Informs that client bootstrapping is waiting for message to be sent. |
ram54288 | 0:a7a43371b306 | 80 | * @param security_object, M2MSecurity Object which contains information about |
ram54288 | 0:a7a43371b306 | 81 | * LWM2M server fetched from bootstrap server. |
ram54288 | 0:a7a43371b306 | 82 | */ |
ram54288 | 0:a7a43371b306 | 83 | virtual void bootstrap_wait(M2MSecurity *security_object) = 0; |
ram54288 | 0:a7a43371b306 | 84 | |
ram54288 | 0:a7a43371b306 | 85 | /** |
ram54288 | 0:a7a43371b306 | 86 | * @brief Informs that some error occured during |
ram54288 | 0:a7a43371b306 | 87 | * bootstrapping. |
ram54288 | 0:a7a43371b306 | 88 | */ |
ram54288 | 0:a7a43371b306 | 89 | virtual void bootstrap_error() = 0; |
ram54288 | 0:a7a43371b306 | 90 | |
ram54288 | 0:a7a43371b306 | 91 | /** |
ram54288 | 0:a7a43371b306 | 92 | * @brief Informs that received data has been processed. |
ram54288 | 0:a7a43371b306 | 93 | */ |
ram54288 | 0:a7a43371b306 | 94 | virtual void coap_data_processed() = 0; |
ram54288 | 0:a7a43371b306 | 95 | |
ram54288 | 0:a7a43371b306 | 96 | /** |
ram54288 | 0:a7a43371b306 | 97 | * @brief Callback informing that the value of the resource object is updated by server. |
ram54288 | 0:a7a43371b306 | 98 | * @param base Object whose value is updated. |
ram54288 | 0:a7a43371b306 | 99 | */ |
ram54288 | 0:a7a43371b306 | 100 | virtual void value_updated(M2MBase *base) = 0; |
ram54288 | 0:a7a43371b306 | 101 | }; |
ram54288 | 0:a7a43371b306 | 102 | #endif // M2M_NSDL_OBSERVER_H |