FRDM K64F Metronome

Committer:
ram54288
Date:
Sun May 14 18:37:05 2017 +0000
Revision:
0:dbad57390bd1
Initial commit

Who changed what in which revision?

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