Rtos API example

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-2016 ARM Limited. All rights reserved.
00003  *
00004  * SPDX-License-Identifier: LicenseRef-PBL
00005  *
00006  * Licensed under the Permissive Binary License, Version 1.0 (the "License"); you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * https://www.mbed.com/licenses/PBL-1.0
00010  *
00011  * See the License for the specific language governing permissions and limitations under the License.
00012  *
00013  */
00014 #ifndef _NET_ADDRESS_EXTENSION_H
00015 #define _NET_ADDRESS_EXTENSION_H
00016 
00017 #include "ns_types.h"
00018 
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 /**
00024   * \file net_address_extension.h
00025   * \brief API for setting up link layer short address manually.
00026   *
00027   * \section set-addr Setting short address
00028   *  - net_ext_set_short_address_from_app(), Sets up a user-specified short address and enables or disables DAD.
00029   *
00030   * NOTE: In case of duplication of address and DAD (duplicate address detection) enabled, i.e., DAD=1, the stack 
00031   * generates a short address dynamically.
00032   *
00033   * - \section reset-addr Resetting short address.
00034   * - net_ext_reset_short_address_from_app(), Clears any user-specified static or default short address and enables dynamic generation.
00035   */
00036 
00037 /**
00038   * \brief Function to set short address from application.
00039   *
00040   * \param short_id 16-bit user-specified short address.
00041   * \param generate_dynamical_at_DAD Set 1 if stack is allowed to generate new short address dynamically in case of DAD, otherwise set 0.
00042   *
00043   * \return 0xfffe or 0xffff when the stack does not use any short address.
00044   */
00045 
00046 extern void net_ext_set_short_address_from_app(uint16_t short_id, uint8_t generate_dynamical_at_DAD);
00047 
00048 /**
00049   * \brief Clears currently used static or default short address and enables dynamic generation of new short address.
00050   */
00051 extern void net_ext_reset_short_address_from_app(void);
00052 
00053 /**
00054   * \brief Get current short address used in the network for this particular interface.
00055   *
00056   * \return 0xfffe or 0xffff if stack is not using any short address.
00057   */
00058 extern uint16_t net_ext_get_short_address(void);
00059 #ifdef __cplusplus
00060 }
00061 #endif
00062 #endif