Ram Gandikota / Mbed OS ABCD
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers m2mnsdlinterface_stub.cpp Source File

m2mnsdlinterface_stub.cpp

00001 /*
00002  * Copyright (c) 2015 ARM Limited. All rights reserved.
00003  * SPDX-License-Identifier: Apache-2.0
00004  * Licensed under the Apache License, Version 2.0 (the License); you may
00005  * not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #include "m2mnsdlinterface_stub.h"
00017 
00018 
00019 bool m2mnsdlinterface_stub::bool_value;
00020 uint32_t m2mnsdlinterface_stub::int_value;
00021 void * m2mnsdlinterface_stub::void_value;
00022 String *m2mnsdlinterface_stub::string_value;
00023 
00024 void m2mnsdlinterface_stub::clear()
00025 {
00026     bool_value = false;
00027     int_value = 0;
00028     *string_value = "";
00029     void_value = NULL;
00030 }
00031 
00032 M2MNsdlInterface::M2MNsdlInterface(M2MNsdlObserver &observer)
00033 : _observer(observer)
00034 {
00035     //m2mnsdlinterface_stub::string_value = new String("");
00036 }
00037 
00038 M2MNsdlInterface::~M2MNsdlInterface()
00039 {
00040     //delete m2mnsdlinterface_stub::string_value;
00041 }
00042 
00043 bool M2MNsdlInterface::initialize()
00044 {
00045     return m2mnsdlinterface_stub::bool_value;
00046 }
00047 
00048 void M2MNsdlInterface::create_endpoint(const String &,
00049                                        const String &,
00050                                        const int32_t,
00051                                        const String &,
00052                                        const uint8_t,
00053                                        const String &)
00054 {
00055 }
00056 
00057 void M2MNsdlInterface::delete_endpoint()
00058 {
00059 }
00060 
00061 bool M2MNsdlInterface::create_nsdl_list_structure(const M2MObjectList &)
00062 {
00063     return m2mnsdlinterface_stub::bool_value;
00064 }
00065 
00066 bool M2MNsdlInterface::remove_nsdl_resource(M2MBase* base)
00067 {
00068     return m2mnsdlinterface_stub::bool_value;
00069 }
00070 
00071 bool M2MNsdlInterface::create_bootstrap_resource(sn_nsdl_addr_s *, const String& name)
00072 {
00073     return m2mnsdlinterface_stub::bool_value;
00074 }
00075 
00076 bool M2MNsdlInterface::send_register_message(uint8_t*,
00077                                              uint8_t,
00078                                              const uint16_t,
00079                                              sn_nsdl_addr_type_e)
00080 {
00081     return m2mnsdlinterface_stub::bool_value;
00082 }
00083 
00084 bool M2MNsdlInterface::send_update_registration(const uint32_t)
00085 {
00086     return m2mnsdlinterface_stub::bool_value;
00087 }
00088 
00089 bool M2MNsdlInterface::send_unregister_message()
00090 {
00091     return m2mnsdlinterface_stub::bool_value;
00092 }
00093 
00094 void *M2MNsdlInterface::memory_alloc(uint16_t size)
00095 {
00096     return malloc(size);
00097 }
00098 
00099 void M2MNsdlInterface::memory_free(void *ptr)
00100 {
00101     free(ptr);
00102     ptr = NULL;
00103 }
00104 
00105 uint8_t M2MNsdlInterface::send_to_server_callback(struct nsdl_s *,
00106                                                   sn_nsdl_capab_e,
00107                                                   uint8_t *,
00108                                                   uint16_t,
00109                                                   sn_nsdl_addr_s *)
00110 {
00111     return (uint8_t)m2mnsdlinterface_stub::int_value;
00112 }
00113 
00114 uint8_t M2MNsdlInterface::received_from_server_callback(struct nsdl_s *,
00115                                                         sn_coap_hdr_s *,
00116                                                         sn_nsdl_addr_s *)
00117 {
00118     return (uint8_t)m2mnsdlinterface_stub::int_value;
00119 }
00120 
00121 uint8_t M2MNsdlInterface::resource_callback(struct nsdl_s *,
00122                                             sn_coap_hdr_s *,
00123                                             sn_nsdl_addr_s *,
00124                                             sn_nsdl_capab_e)
00125 {
00126     return (uint8_t)m2mnsdlinterface_stub::int_value;
00127 }
00128 
00129 
00130 bool M2MNsdlInterface::process_received_data(uint8_t *,
00131                                              uint16_t ,
00132                                              sn_nsdl_addr_s *)
00133 {
00134     return m2mnsdlinterface_stub::bool_value;
00135 }
00136 
00137 void M2MNsdlInterface::stop_timers()
00138 {
00139 
00140 }
00141 
00142 void M2MNsdlInterface::timer_expired(M2MTimerObserver::Type)
00143 {
00144 }
00145 
00146 void M2MNsdlInterface::observation_to_be_sent(M2MBase *, uint16_t, Vector<uint16_t>, bool)
00147 {
00148 }
00149 
00150 void M2MNsdlInterface::send_delayed_response(M2MBase *)
00151 {
00152 }
00153 
00154 void M2MNsdlInterface::resource_to_be_deleted(M2MBase *)
00155 {
00156 }
00157 
00158 void M2MNsdlInterface::value_updated(M2MBase *, const String&)
00159 {
00160 }
00161 
00162 void M2MNsdlInterface::remove_object(M2MBase *)
00163 {
00164 }
00165 
00166 nsdl_s* M2MNsdlInterface::get_nsdl_handle()
00167 {
00168     return (nsdl_s*) m2mnsdlinterface_stub::void_value;
00169 }
00170 
00171 void M2MNsdlInterface::handle_bootstrap_put_message(sn_coap_hdr_s *coap_header, sn_nsdl_addr_s *address)
00172 {
00173 
00174 }
00175 
00176 void M2MNsdlInterface::handle_bootstrap_finished(sn_coap_hdr_s *coap_header,sn_nsdl_addr_s *address)
00177 {
00178 
00179 }
00180 
00181 void M2MNsdlInterface::handle_bootstrap_delete(sn_coap_hdr_s *coap_header,sn_nsdl_addr_s *address)
00182 {
00183 
00184 }
00185 
00186 bool M2MNsdlInterface::parse_bootstrap_message(sn_coap_hdr_s *coap_header, bool is_security_object)
00187 {
00188 
00189 }
00190 
00191 bool M2MNsdlInterface::validate_security_object()
00192 {
00193 
00194 }
00195 
00196 void M2MNsdlInterface::handle_bootstrap_error()
00197 {
00198 
00199 }
00200 
00201 const String& M2MNsdlInterface::endpoint_name() const
00202 {
00203     return *m2mnsdlinterface_stub::string_value;
00204 }