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

« Back to documentation index

Show/hide line numbers m2mconnectionhandlerpimpl_stub.cpp Source File

m2mconnectionhandlerpimpl_stub.cpp

00001 /*
00002  * Copyright (c) 2016 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 "m2mconnectionhandlerpimpl_stub.h"
00017 #include "mbed-client-classic/m2mconnectionhandlerpimpl.h"
00018 #include "m2mconnectionsecurity.h"
00019 
00020 int m2mconnectionhandlerpimpl_stub::int_value;
00021 uint16_t m2mconnectionhandlerpimpl_stub::uint_value;
00022 bool m2mconnectionhandlerpimpl_stub::bool_value;
00023 
00024 void m2mconnectionhandlerpimpl_stub::clear()
00025 {
00026     int_value = -1;
00027     uint_value = 0;
00028     bool_value = false;
00029 }
00030 
00031 M2MConnectionHandlerPimpl::M2MConnectionHandlerPimpl(M2MConnectionHandler* base, M2MConnectionObserver &observer,
00032                                                      M2MConnectionSecurity* sec,
00033                                                      M2MInterface::BindingMode,
00034                                                      M2MInterface::NetworkStack)
00035 :_observer(observer)
00036 {
00037     if( sec ){
00038         delete sec;
00039         sec = NULL;
00040     }
00041 }
00042 
00043 M2MConnectionHandlerPimpl::~M2MConnectionHandlerPimpl()
00044 {
00045 }
00046 
00047 bool M2MConnectionHandlerPimpl::bind_connection(const uint16_t)
00048 {
00049     return m2mconnectionhandlerpimpl_stub::bool_value;
00050 }
00051 
00052 bool M2MConnectionHandlerPimpl::resolve_server_address(const String&,
00053                                                   const uint16_t,
00054                                                   M2MConnectionObserver::ServerType,
00055                                                   const M2MSecurity* )
00056 {
00057     return m2mconnectionhandlerpimpl_stub::bool_value;
00058 }
00059 
00060 bool M2MConnectionHandlerPimpl::start_listening_for_data()
00061 {
00062     return m2mconnectionhandlerpimpl_stub::bool_value;
00063 }
00064 
00065 bool M2MConnectionHandlerPimpl::send_data(uint8_t *,
00066                                      uint16_t ,
00067                                      sn_nsdl_addr_s *)
00068 {
00069     return m2mconnectionhandlerpimpl_stub::bool_value;
00070 }
00071 
00072 void M2MConnectionHandlerPimpl::stop_listening()
00073 {
00074 }
00075 
00076 int M2MConnectionHandlerPimpl::send_to_socket(const unsigned char *, size_t ){
00077     return m2mconnectionhandlerpimpl_stub::int_value;
00078 }
00079 
00080 int M2MConnectionHandlerPimpl::receive_from_socket(unsigned char *buf, size_t len){
00081     return m2mconnectionhandlerpimpl_stub::int_value;
00082 }
00083 //void M2MConnectionHandlerPimpl::data_receive(void *object)
00084 //{
00085 //
00086 //}
00087 
00088 void M2MConnectionHandlerPimpl::handle_connection_error(int )
00089 {
00090 
00091 }
00092 
00093 void M2MConnectionHandlerPimpl::claim_mutex(void){}
00094 
00095 void M2MConnectionHandlerPimpl::release_mutex(void){}
00096 
00097 void M2MConnectionHandlerPimpl::set_platform_network_handler(void*){}
00098 
00099