Gleb Klochkov / Mbed OS Climatcontroll_Main

Dependencies:   esp8266-driver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers net_address_extension.h Source File

net_address_extension.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2013-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 #ifndef _NET_ADDRESS_EXTENSION_H
00018 #define _NET_ADDRESS_EXTENSION_H
00019 
00020 #include "ns_types.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 /**
00027   * \file net_address_extension.h
00028   * \brief API for setting up link layer short address manually.
00029   *
00030   * \section set-addr Setting short address
00031   *  - net_ext_set_short_address_from_app(), Sets up a user-specified short address and enables or disables DAD.
00032   *
00033   * NOTE: In case of duplication of address and DAD (duplicate address detection) enabled, i.e., DAD=1, the stack 
00034   * generates a short address dynamically.
00035   *
00036   * - \section reset-addr Resetting short address.
00037   * - net_ext_reset_short_address_from_app(), Clears any user-specified static or default short address and enables dynamic generation.
00038   */
00039 
00040 /**
00041   * \brief Function to set short address from application.
00042   *
00043   * \param short_id 16-bit user-specified short address.
00044   * \param generate_dynamical_at_DAD Set 1 if stack is allowed to generate new short address dynamically in case of DAD, otherwise set 0.
00045   *
00046   * \return 0xfffe or 0xffff when the stack does not use any short address.
00047   */
00048 
00049 extern void net_ext_set_short_address_from_app(uint16_t short_id, uint8_t generate_dynamical_at_DAD);
00050 
00051 /**
00052   * \brief Clears currently used static or default short address and enables dynamic generation of new short address.
00053   */
00054 extern void net_ext_reset_short_address_from_app(void);
00055 
00056 /**
00057   * \brief Get current short address used in the network for this particular interface.
00058   *
00059   * \return 0xfffe or 0xffff if stack is not using any short address.
00060   */
00061 extern uint16_t net_ext_get_short_address(void);
00062 #ifdef __cplusplus
00063 }
00064 #endif
00065 #endif