takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nsapi_dns_stub.cpp Source File

nsapi_dns_stub.cpp

00001 /*
00002  * Copyright (c) 2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #include "netsocket/nsapi_dns.h"
00019 
00020 
00021 nsapi_error_t nsapi_stub_return_value = NSAPI_ERROR_DNS_FAILURE ;
00022 NetworkStack::hostbyname_cb_t query_callback;
00023 call_in_callback_cb_t callin_callback;
00024 
00025 nsapi_error_t nsapi_dns_query(NetworkStack *stack, const char *host,
00026                               SocketAddress *addr, nsapi_version_t version)
00027 {
00028     return nsapi_stub_return_value;
00029 }
00030 
00031 nsapi_error_t nsapi_dns_query_async(NetworkStack *stack, const char *host,
00032                                     NetworkStack::hostbyname_cb_t callback, call_in_callback_cb_t call_in_cb,
00033                                     nsapi_version_t version)
00034 {
00035     query_callback = callback;
00036     callin_callback = call_in_cb;
00037     return nsapi_stub_return_value;
00038 }
00039 
00040 nsapi_error_t nsapi_dns_query_async_cancel(nsapi_error_t id)
00041 {
00042     return nsapi_stub_return_value;
00043 }
00044 
00045 extern "C" nsapi_error_t nsapi_dns_add_server(nsapi_addr_t addr)
00046 {
00047     return NSAPI_ERROR_OK ;
00048 }