![](/media/cache/profiles/debfdc81854eac26ec993b55a659c6e1.jpg.50x50_q85.jpg)
mbed client lightswitch demo
Dependencies: mbed Socket lwip-eth lwip-sys lwip
Fork of mbed-client-classic-example-lwip by
mbed-client/source/include/m2mnsdlinterface.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 M2MNSDLINTERFACE_H |
mbedAustin | 11:cada08fc8a70 | 17 | #define M2MNSDLINTERFACE_H |
mbedAustin | 11:cada08fc8a70 | 18 | |
mbedAustin | 11:cada08fc8a70 | 19 | #include "mbed-client/m2mvector.h" |
mbedAustin | 11:cada08fc8a70 | 20 | #include "mbed-client/m2mconfig.h" |
mbedAustin | 11:cada08fc8a70 | 21 | #include "mbed-client/m2minterface.h" |
mbedAustin | 11:cada08fc8a70 | 22 | #include "mbed-client/m2mtimerobserver.h" |
mbedAustin | 11:cada08fc8a70 | 23 | #include "mbed-client/m2mobservationhandler.h" |
mbedAustin | 11:cada08fc8a70 | 24 | #include "include/nsdllinker.h" |
mbedAustin | 11:cada08fc8a70 | 25 | |
mbedAustin | 11:cada08fc8a70 | 26 | //FORWARD DECLARARTION |
mbedAustin | 11:cada08fc8a70 | 27 | class M2MSecurity; |
mbedAustin | 11:cada08fc8a70 | 28 | class M2MObject; |
mbedAustin | 11:cada08fc8a70 | 29 | class M2MObjectInstance; |
mbedAustin | 11:cada08fc8a70 | 30 | class M2MResource; |
mbedAustin | 11:cada08fc8a70 | 31 | class M2MResourceInstance; |
mbedAustin | 11:cada08fc8a70 | 32 | class M2MNsdlObserver; |
mbedAustin | 11:cada08fc8a70 | 33 | class M2MBase; |
mbedAustin | 11:cada08fc8a70 | 34 | class M2MServer; |
mbedAustin | 11:cada08fc8a70 | 35 | class M2MTimer; |
mbedAustin | 11:cada08fc8a70 | 36 | |
mbedAustin | 11:cada08fc8a70 | 37 | typedef Vector<M2MObject *> M2MObjectList; |
mbedAustin | 11:cada08fc8a70 | 38 | |
mbedAustin | 11:cada08fc8a70 | 39 | /** |
mbedAustin | 11:cada08fc8a70 | 40 | * @brief M2MNsdlInterface |
mbedAustin | 11:cada08fc8a70 | 41 | * Class which interacts between mbed Client C++ Library and mbed-client-c library. |
mbedAustin | 11:cada08fc8a70 | 42 | */ |
mbedAustin | 11:cada08fc8a70 | 43 | class M2MNsdlInterface : public M2MTimerObserver, |
mbedAustin | 11:cada08fc8a70 | 44 | public M2MObservationHandler |
mbedAustin | 11:cada08fc8a70 | 45 | { |
mbedAustin | 11:cada08fc8a70 | 46 | private: |
mbedAustin | 11:cada08fc8a70 | 47 | // Prevents the use of assignment operator by accident. |
mbedAustin | 11:cada08fc8a70 | 48 | M2MNsdlInterface& operator=( const M2MNsdlInterface& /*other*/ ); |
mbedAustin | 11:cada08fc8a70 | 49 | |
mbedAustin | 11:cada08fc8a70 | 50 | // Prevents the use of copy constructor by accident |
mbedAustin | 11:cada08fc8a70 | 51 | M2MNsdlInterface( const M2MNsdlInterface& /*other*/ ); |
mbedAustin | 11:cada08fc8a70 | 52 | |
mbedAustin | 11:cada08fc8a70 | 53 | public: |
mbedAustin | 11:cada08fc8a70 | 54 | /** |
mbedAustin | 11:cada08fc8a70 | 55 | * @brief Constructor |
mbedAustin | 11:cada08fc8a70 | 56 | * @param observer, Observer to pass the event callbacks from nsdl library. |
mbedAustin | 11:cada08fc8a70 | 57 | */ |
mbedAustin | 11:cada08fc8a70 | 58 | M2MNsdlInterface(M2MNsdlObserver &observer); |
mbedAustin | 11:cada08fc8a70 | 59 | |
mbedAustin | 11:cada08fc8a70 | 60 | /** |
mbedAustin | 11:cada08fc8a70 | 61 | * @brief Destructor |
mbedAustin | 11:cada08fc8a70 | 62 | */ |
mbedAustin | 11:cada08fc8a70 | 63 | virtual ~M2MNsdlInterface(); |
mbedAustin | 11:cada08fc8a70 | 64 | |
mbedAustin | 11:cada08fc8a70 | 65 | /** |
mbedAustin | 11:cada08fc8a70 | 66 | * @brief Creates endpoint object for the nsdl stack. |
mbedAustin | 11:cada08fc8a70 | 67 | * @param endpoint_name, Endpoint name of the client. |
mbedAustin | 11:cada08fc8a70 | 68 | * @param endpoint_type, Endpoint type of the client. |
mbedAustin | 11:cada08fc8a70 | 69 | * @param life_time, Life time of the client in seconds |
mbedAustin | 11:cada08fc8a70 | 70 | * @param domain, Domain of the client. |
mbedAustin | 11:cada08fc8a70 | 71 | * @param mode, Binding mode of the client, default is UDP |
mbedAustin | 11:cada08fc8a70 | 72 | * @param context_address, Context address default is empty. |
mbedAustin | 11:cada08fc8a70 | 73 | */ |
mbedAustin | 11:cada08fc8a70 | 74 | void create_endpoint(const String &endpoint_name, |
mbedAustin | 11:cada08fc8a70 | 75 | const String &endpoint_type, |
mbedAustin | 11:cada08fc8a70 | 76 | const int32_t life_time, |
mbedAustin | 11:cada08fc8a70 | 77 | const String &domain, |
mbedAustin | 11:cada08fc8a70 | 78 | const uint8_t mode, |
mbedAustin | 11:cada08fc8a70 | 79 | const String &context_address); |
mbedAustin | 11:cada08fc8a70 | 80 | |
mbedAustin | 11:cada08fc8a70 | 81 | /** |
mbedAustin | 11:cada08fc8a70 | 82 | * @brief Deletes the endpoint. |
mbedAustin | 11:cada08fc8a70 | 83 | */ |
mbedAustin | 11:cada08fc8a70 | 84 | void delete_endpoint(); |
mbedAustin | 11:cada08fc8a70 | 85 | |
mbedAustin | 11:cada08fc8a70 | 86 | /** |
mbedAustin | 11:cada08fc8a70 | 87 | * @brief Creates the NSDL structure for the registered objectlist. |
mbedAustin | 11:cada08fc8a70 | 88 | * @param object_list, List of objects to be registered. |
mbedAustin | 11:cada08fc8a70 | 89 | * @return true if structure created successfully else false. |
mbedAustin | 11:cada08fc8a70 | 90 | */ |
mbedAustin | 11:cada08fc8a70 | 91 | bool create_nsdl_list_structure(const M2MObjectList &object_list); |
mbedAustin | 11:cada08fc8a70 | 92 | |
mbedAustin | 11:cada08fc8a70 | 93 | /** |
mbedAustin | 11:cada08fc8a70 | 94 | * @brief Removed the NSDL resource for the given resource. |
mbedAustin | 11:cada08fc8a70 | 95 | * @param resource_name, Resource name to be removed. |
mbedAustin | 11:cada08fc8a70 | 96 | * @return true if removed successfully else false. |
mbedAustin | 11:cada08fc8a70 | 97 | */ |
mbedAustin | 11:cada08fc8a70 | 98 | bool delete_nsdl_resource(const String &resource_name); |
mbedAustin | 11:cada08fc8a70 | 99 | |
mbedAustin | 11:cada08fc8a70 | 100 | /** |
mbedAustin | 11:cada08fc8a70 | 101 | * @brief Creates the bootstrap object. |
mbedAustin | 11:cada08fc8a70 | 102 | * @param address Bootstrap address. |
mbedAustin | 11:cada08fc8a70 | 103 | * @return true if created and sent successfully else false. |
mbedAustin | 11:cada08fc8a70 | 104 | */ |
mbedAustin | 11:cada08fc8a70 | 105 | bool create_bootstrap_resource(sn_nsdl_addr_s *address); |
mbedAustin | 11:cada08fc8a70 | 106 | |
mbedAustin | 11:cada08fc8a70 | 107 | /** |
mbedAustin | 11:cada08fc8a70 | 108 | * @brief Sends the register message to the server. |
mbedAustin | 11:cada08fc8a70 | 109 | * @param address M2MServer address. |
mbedAustin | 11:cada08fc8a70 | 110 | * @param port M2MServer port. |
mbedAustin | 11:cada08fc8a70 | 111 | * @param address_type IP Address type. |
mbedAustin | 11:cada08fc8a70 | 112 | * @return true if register sent successfully else false. |
mbedAustin | 11:cada08fc8a70 | 113 | */ |
mbedAustin | 11:cada08fc8a70 | 114 | bool send_register_message(uint8_t* address, |
mbedAustin | 11:cada08fc8a70 | 115 | const uint16_t port, |
mbedAustin | 11:cada08fc8a70 | 116 | sn_nsdl_addr_type_e address_type); |
mbedAustin | 11:cada08fc8a70 | 117 | |
mbedAustin | 11:cada08fc8a70 | 118 | /** |
mbedAustin | 11:cada08fc8a70 | 119 | * @brief Sends the update registration message to the server. |
mbedAustin | 11:cada08fc8a70 | 120 | * @param lifetime, Updated lifetime value in seconds. |
mbedAustin | 11:cada08fc8a70 | 121 | * @return true if sent successfully else false. |
mbedAustin | 11:cada08fc8a70 | 122 | * |
mbedAustin | 11:cada08fc8a70 | 123 | */ |
mbedAustin | 11:cada08fc8a70 | 124 | bool send_update_registration(const uint32_t lifetime = 0); |
mbedAustin | 11:cada08fc8a70 | 125 | |
mbedAustin | 11:cada08fc8a70 | 126 | /** |
mbedAustin | 11:cada08fc8a70 | 127 | * @brief Sends unregister message to the server. |
mbedAustin | 11:cada08fc8a70 | 128 | * @return true if unregister sent successfully else false. |
mbedAustin | 11:cada08fc8a70 | 129 | */ |
mbedAustin | 11:cada08fc8a70 | 130 | bool send_unregister_message(); |
mbedAustin | 11:cada08fc8a70 | 131 | |
mbedAustin | 11:cada08fc8a70 | 132 | /** |
mbedAustin | 11:cada08fc8a70 | 133 | * @brief Memory Allocation required for libCoap. |
mbedAustin | 11:cada08fc8a70 | 134 | * @param size, Size of memory to be reserved. |
mbedAustin | 11:cada08fc8a70 | 135 | */ |
mbedAustin | 11:cada08fc8a70 | 136 | void* memory_alloc(uint16_t size); |
mbedAustin | 11:cada08fc8a70 | 137 | |
mbedAustin | 11:cada08fc8a70 | 138 | /** |
mbedAustin | 11:cada08fc8a70 | 139 | * @brief Memory free functions required for libCoap |
mbedAustin | 11:cada08fc8a70 | 140 | * @param ptr, Object whose memory needs to be freed. |
mbedAustin | 11:cada08fc8a70 | 141 | */ |
mbedAustin | 11:cada08fc8a70 | 142 | void memory_free(void *ptr); |
mbedAustin | 11:cada08fc8a70 | 143 | |
mbedAustin | 11:cada08fc8a70 | 144 | /** |
mbedAustin | 11:cada08fc8a70 | 145 | * @brief Callback from nsdl library to inform the data is ready |
mbedAustin | 11:cada08fc8a70 | 146 | * to be sent to server. |
mbedAustin | 11:cada08fc8a70 | 147 | * @param nsdl_handle, Handler for the nsdl structure for this endpoint |
mbedAustin | 11:cada08fc8a70 | 148 | * @param protocol, Protocol format of the data |
mbedAustin | 11:cada08fc8a70 | 149 | * @param data, Data to be sent. |
mbedAustin | 11:cada08fc8a70 | 150 | * @param data_len, Size of the data to be sent |
mbedAustin | 11:cada08fc8a70 | 151 | * @param address, server address where data has to be sent. |
mbedAustin | 11:cada08fc8a70 | 152 | * @return 1 if successful else 0. |
mbedAustin | 11:cada08fc8a70 | 153 | */ |
mbedAustin | 11:cada08fc8a70 | 154 | uint8_t send_to_server_callback(struct nsdl_s * nsdl_handle, |
mbedAustin | 11:cada08fc8a70 | 155 | sn_nsdl_capab_e protocol, |
mbedAustin | 11:cada08fc8a70 | 156 | uint8_t *data, |
mbedAustin | 11:cada08fc8a70 | 157 | uint16_t data_len, |
mbedAustin | 11:cada08fc8a70 | 158 | sn_nsdl_addr_s *address); |
mbedAustin | 11:cada08fc8a70 | 159 | |
mbedAustin | 11:cada08fc8a70 | 160 | /** |
mbedAustin | 11:cada08fc8a70 | 161 | * @brief Callback from nsdl library to inform the data which is |
mbedAustin | 11:cada08fc8a70 | 162 | * received from server for the client has been converted to coap message. |
mbedAustin | 11:cada08fc8a70 | 163 | * @param nsdl_handle, Handler for the nsdl structure for this endpoint |
mbedAustin | 11:cada08fc8a70 | 164 | * @param coap_header, Coap message formed from data. |
mbedAustin | 11:cada08fc8a70 | 165 | * @param address, Server address from where the data is received. |
mbedAustin | 11:cada08fc8a70 | 166 | * @return 1 if successful else 0. |
mbedAustin | 11:cada08fc8a70 | 167 | */ |
mbedAustin | 11:cada08fc8a70 | 168 | uint8_t received_from_server_callback(struct nsdl_s * nsdl_handle, |
mbedAustin | 11:cada08fc8a70 | 169 | sn_coap_hdr_s *coap_header, |
mbedAustin | 11:cada08fc8a70 | 170 | sn_nsdl_addr_s *address); |
mbedAustin | 11:cada08fc8a70 | 171 | |
mbedAustin | 11:cada08fc8a70 | 172 | /** |
mbedAustin | 11:cada08fc8a70 | 173 | * @brief Callback from nsdl library to inform the data which is |
mbedAustin | 11:cada08fc8a70 | 174 | * received from server for the resources has been converted to coap message. |
mbedAustin | 11:cada08fc8a70 | 175 | * @param nsdl_handle, Handler for the nsdl resource structure for this endpoint.. |
mbedAustin | 11:cada08fc8a70 | 176 | * @param coap_header, Coap message formed from data. |
mbedAustin | 11:cada08fc8a70 | 177 | * @param address, Server address from where the data is received. |
mbedAustin | 11:cada08fc8a70 | 178 | * @param nsdl_capab, Protocol for the message, currently only coap is supported. |
mbedAustin | 11:cada08fc8a70 | 179 | * @return 1 if successful else 0. |
mbedAustin | 11:cada08fc8a70 | 180 | */ |
mbedAustin | 11:cada08fc8a70 | 181 | uint8_t resource_callback(struct nsdl_s *nsdl_handle, sn_coap_hdr_s *coap, |
mbedAustin | 11:cada08fc8a70 | 182 | sn_nsdl_addr_s *address, |
mbedAustin | 11:cada08fc8a70 | 183 | sn_nsdl_capab_e nsdl_capab); |
mbedAustin | 11:cada08fc8a70 | 184 | |
mbedAustin | 11:cada08fc8a70 | 185 | /** |
mbedAustin | 11:cada08fc8a70 | 186 | * @brief Callback when the bootstrap information is received from bootstrap server. |
mbedAustin | 11:cada08fc8a70 | 187 | * @param server_info, Server information received from bootstrap server. |
mbedAustin | 11:cada08fc8a70 | 188 | */ |
mbedAustin | 11:cada08fc8a70 | 189 | void bootstrap_done_callback(sn_nsdl_oma_server_info_t *server_info); |
mbedAustin | 11:cada08fc8a70 | 190 | |
mbedAustin | 11:cada08fc8a70 | 191 | /** |
mbedAustin | 11:cada08fc8a70 | 192 | * @brief Callback when there is data received from server and needs to be processed. |
mbedAustin | 11:cada08fc8a70 | 193 | * @param data, data received from server. |
mbedAustin | 11:cada08fc8a70 | 194 | * @param data_size, data size received from server. |
mbedAustin | 11:cada08fc8a70 | 195 | * @param addres, address structure of the server. |
mbedAustin | 11:cada08fc8a70 | 196 | * @return true if successfully processed else false. |
mbedAustin | 11:cada08fc8a70 | 197 | */ |
mbedAustin | 11:cada08fc8a70 | 198 | bool process_received_data(uint8_t *data, |
mbedAustin | 11:cada08fc8a70 | 199 | uint16_t data_size, |
mbedAustin | 11:cada08fc8a70 | 200 | sn_nsdl_addr_s *address); |
mbedAustin | 11:cada08fc8a70 | 201 | |
mbedAustin | 11:cada08fc8a70 | 202 | /** |
mbedAustin | 11:cada08fc8a70 | 203 | * @brief Stops all the timers in case there is any errors. |
mbedAustin | 11:cada08fc8a70 | 204 | */ |
mbedAustin | 11:cada08fc8a70 | 205 | void stop_timers(); |
mbedAustin | 11:cada08fc8a70 | 206 | |
mbedAustin | 11:cada08fc8a70 | 207 | protected: // from M2MTimerObserver |
mbedAustin | 11:cada08fc8a70 | 208 | |
mbedAustin | 11:cada08fc8a70 | 209 | virtual void timer_expired(M2MTimerObserver::Type type); |
mbedAustin | 11:cada08fc8a70 | 210 | |
mbedAustin | 11:cada08fc8a70 | 211 | protected: // from M2MObservationHandler |
mbedAustin | 11:cada08fc8a70 | 212 | |
mbedAustin | 11:cada08fc8a70 | 213 | virtual void observation_to_be_sent(M2MBase *object); |
mbedAustin | 11:cada08fc8a70 | 214 | |
mbedAustin | 11:cada08fc8a70 | 215 | virtual void resource_to_be_deleted(const String &resource_name); |
mbedAustin | 11:cada08fc8a70 | 216 | |
mbedAustin | 11:cada08fc8a70 | 217 | virtual void value_updated(M2MBase *base, const String &object_name); |
mbedAustin | 11:cada08fc8a70 | 218 | |
mbedAustin | 11:cada08fc8a70 | 219 | virtual void remove_object(M2MBase *object); |
mbedAustin | 11:cada08fc8a70 | 220 | |
mbedAustin | 11:cada08fc8a70 | 221 | private: |
mbedAustin | 11:cada08fc8a70 | 222 | |
mbedAustin | 11:cada08fc8a70 | 223 | /** |
mbedAustin | 11:cada08fc8a70 | 224 | * @brief Initializes all the nsdl library component to be usable. |
mbedAustin | 11:cada08fc8a70 | 225 | * @return true if initialization is successful else false. |
mbedAustin | 11:cada08fc8a70 | 226 | */ |
mbedAustin | 11:cada08fc8a70 | 227 | bool initialize(); |
mbedAustin | 11:cada08fc8a70 | 228 | |
mbedAustin | 11:cada08fc8a70 | 229 | bool add_object_to_list(M2MObject *object); |
mbedAustin | 11:cada08fc8a70 | 230 | |
mbedAustin | 11:cada08fc8a70 | 231 | bool create_nsdl_object_structure(M2MObject *object); |
mbedAustin | 11:cada08fc8a70 | 232 | |
mbedAustin | 11:cada08fc8a70 | 233 | bool create_nsdl_object_instance_structure(M2MObjectInstance *object_instance); |
mbedAustin | 11:cada08fc8a70 | 234 | |
mbedAustin | 11:cada08fc8a70 | 235 | bool create_nsdl_resource_structure(M2MResource *resource, |
mbedAustin | 11:cada08fc8a70 | 236 | const String &object_name = "", |
mbedAustin | 11:cada08fc8a70 | 237 | bool multiple_instances = false); |
mbedAustin | 11:cada08fc8a70 | 238 | |
mbedAustin | 11:cada08fc8a70 | 239 | bool create_nsdl_resource(M2MBase *base, const String &name = ""); |
mbedAustin | 11:cada08fc8a70 | 240 | |
mbedAustin | 11:cada08fc8a70 | 241 | String coap_to_string(uint8_t *coap_data_ptr, |
mbedAustin | 11:cada08fc8a70 | 242 | int coap_data_ptr_length); |
mbedAustin | 11:cada08fc8a70 | 243 | |
mbedAustin | 11:cada08fc8a70 | 244 | void execute_nsdl_process_loop(); |
mbedAustin | 11:cada08fc8a70 | 245 | |
mbedAustin | 11:cada08fc8a70 | 246 | uint64_t registration_time(); |
mbedAustin | 11:cada08fc8a70 | 247 | |
mbedAustin | 11:cada08fc8a70 | 248 | M2MBase* find_resource(const String &object); |
mbedAustin | 11:cada08fc8a70 | 249 | |
mbedAustin | 11:cada08fc8a70 | 250 | M2MBase* find_resource(const M2MObject *object, |
mbedAustin | 11:cada08fc8a70 | 251 | const String &object_instance); |
mbedAustin | 11:cada08fc8a70 | 252 | |
mbedAustin | 11:cada08fc8a70 | 253 | M2MBase* find_resource(const M2MObjectInstance *object_instance, |
mbedAustin | 11:cada08fc8a70 | 254 | const String &resource_instance); |
mbedAustin | 11:cada08fc8a70 | 255 | |
mbedAustin | 11:cada08fc8a70 | 256 | M2MBase* find_resource(const M2MResource *resource, |
mbedAustin | 11:cada08fc8a70 | 257 | const String &object_name, |
mbedAustin | 11:cada08fc8a70 | 258 | const String &resource_instance); |
mbedAustin | 11:cada08fc8a70 | 259 | |
mbedAustin | 11:cada08fc8a70 | 260 | bool object_present(M2MObject * object) const; |
mbedAustin | 11:cada08fc8a70 | 261 | |
mbedAustin | 11:cada08fc8a70 | 262 | void clear_resource(sn_nsdl_resource_info_s *&resource); |
mbedAustin | 11:cada08fc8a70 | 263 | |
mbedAustin | 11:cada08fc8a70 | 264 | M2MInterface::Error interface_error(sn_coap_hdr_s *coap_header); |
mbedAustin | 11:cada08fc8a70 | 265 | |
mbedAustin | 11:cada08fc8a70 | 266 | void send_object_observation(M2MObject *object); |
mbedAustin | 11:cada08fc8a70 | 267 | |
mbedAustin | 11:cada08fc8a70 | 268 | void send_object_instance_observation(M2MObjectInstance *object_instance); |
mbedAustin | 11:cada08fc8a70 | 269 | |
mbedAustin | 11:cada08fc8a70 | 270 | void send_resource_observation(M2MResource *resource); |
mbedAustin | 11:cada08fc8a70 | 271 | |
mbedAustin | 11:cada08fc8a70 | 272 | private: |
mbedAustin | 11:cada08fc8a70 | 273 | |
mbedAustin | 11:cada08fc8a70 | 274 | M2MNsdlObserver &_observer; |
mbedAustin | 11:cada08fc8a70 | 275 | M2MObjectList _object_list; |
mbedAustin | 11:cada08fc8a70 | 276 | M2MServer *_server; |
mbedAustin | 11:cada08fc8a70 | 277 | M2MTimer *_nsdl_exceution_timer; |
mbedAustin | 11:cada08fc8a70 | 278 | M2MTimer *_registration_timer; |
mbedAustin | 11:cada08fc8a70 | 279 | sn_nsdl_ep_parameters_s *_endpoint; |
mbedAustin | 11:cada08fc8a70 | 280 | sn_nsdl_resource_info_s *_resource; |
mbedAustin | 11:cada08fc8a70 | 281 | sn_nsdl_bs_ep_info_t _bootstrap_endpoint; |
mbedAustin | 11:cada08fc8a70 | 282 | sn_nsdl_oma_device_t _bootstrap_device_setup; |
mbedAustin | 11:cada08fc8a70 | 283 | sn_nsdl_addr_s _sn_nsdl_address; |
mbedAustin | 11:cada08fc8a70 | 284 | nsdl_s *_nsdl_handle; |
mbedAustin | 11:cada08fc8a70 | 285 | uint32_t _counter_for_nsdl; |
mbedAustin | 11:cada08fc8a70 | 286 | uint16_t _register_id; |
mbedAustin | 11:cada08fc8a70 | 287 | uint16_t _unregister_id; |
mbedAustin | 11:cada08fc8a70 | 288 | uint16_t _update_id; |
mbedAustin | 11:cada08fc8a70 | 289 | uint16_t _bootstrap_id; |
mbedAustin | 11:cada08fc8a70 | 290 | |
mbedAustin | 11:cada08fc8a70 | 291 | friend class Test_M2MNsdlInterface; |
mbedAustin | 11:cada08fc8a70 | 292 | |
mbedAustin | 11:cada08fc8a70 | 293 | }; |
mbedAustin | 11:cada08fc8a70 | 294 | |
mbedAustin | 11:cada08fc8a70 | 295 | #endif // M2MNSDLINTERFACE_H |