BA / Mbed OS BaBoRo1
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers thread_border_router_api_internal.h Source File

thread_border_router_api_internal.h

00001 /*
00002  * Copyright (c) 2016-2017, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: BSD-3-Clause
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  * 3. Neither the name of the copyright holder nor the
00014  *    names of its contributors may be used to endorse or promote products
00015  *    derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00018  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00021  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00022  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00023  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00024  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00025  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00026  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00027  * POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 /**
00031  * \brief Nanostack Border Router instance and corresponding methods.
00032  */
00033 
00034 #ifndef THREAD_BORDER_ROUTER_API_INTERNAL_H_
00035 #define THREAD_BORDER_ROUTER_API_INTERNAL_H_
00036 
00037 #include "net_interface.h"
00038 
00039 #ifdef HAVE_THREAD_ROUTER
00040 
00041 /**
00042  * \brief Initialize thread border router instance
00043  *
00044  * \param interface_id current interface id
00045  * \param external_commisssioner_port port for external commissioner
00046  *
00047  * \return 0 on success, <0 in case of error
00048  */
00049 int8_t thread_border_router_init(int8_t interface_id);
00050 
00051 /**
00052  * \brief Delete thread border router instance
00053  *
00054  * \param interface_id current interface id
00055  */
00056 void thread_border_router_delete(int8_t interface_id);
00057 
00058 /**
00059  * \brief seconds timer for border router
00060  *
00061  * \param interface_id current interface id
00062  * \param tics seconds pass since last call
00063  */
00064 void thread_border_router_seconds_timer(int8_t interface_id, uint32_t tics);
00065 
00066 /**
00067  * \brief Set thread resubmit timer timeout.
00068  *
00069  * \param interface_id Network interface ID.
00070  * \param seconds seconds to set to the timer,. -1 to initialize to default value.
00071   */
00072 void thread_border_router_resubmit_timer_set(int8_t interface_id, int16_t seconds);
00073 
00074 /**
00075  * \brief Call application callback with current Network Data TLV
00076  *
00077  * \param cur current interface entry
00078  */
00079 void thread_border_router_network_data_appl_callback(protocol_interface_info_entry_t *cur);
00080 
00081 /**
00082  * \brief Notify about network data update.
00083  *
00084  * \param cur current interface entry
00085  *
00086  */
00087 void thread_border_router_network_data_update_notify(protocol_interface_info_entry_t *cur);
00088 #else
00089 #define thread_border_router_init(interface_id)
00090 #define thread_border_router_delete(interface_id)
00091 #define thread_border_router_seconds_timer(interface_id, tics)
00092 #define thread_border_router_resubmit_timer_set(interface_id, seconds)
00093 #define thread_border_router_network_data_appl_callback(cur)
00094 #define thread_border_router_network_data_update_notify(cur)
00095 
00096 #endif
00097 #endif /* THREAD_BORDER_ROUTER_API_INTERNAL_H_ */