summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkAddress.h
blob: b3516b86d95eba060129cf8708e6d186a1d8d69e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**************************************************************************//**
  \file nwkAddress.h

  \brief Formation header file.

  \author
    Atmel Corporation: http://www.atmel.com \n
    Support email: avr@atmel.com

  Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
  Licensed under Atmel's Limited License Agreement (BitCloudTM).

  \internal
   History:
    2009-05-12 M. Gekk - Created.
   Last change:
    $Id: nwkAddress.h 17923 2011-07-08 14:13:30Z mgekk $
 ******************************************************************************/
#if !defined _NWK_ADDRESS_H
#define _NWK_ADDRESS_H

/******************************************************************************
                                Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <types.h>
#include <mac.h>
#include <nwkCommon.h>
#include <nwkSystem.h>

/******************************************************************************
                               Prototypes section
 ******************************************************************************/
#if defined _COORDINATOR_ || defined _ROUTER_
/**************************************************************************//**
  \brief Allocate short address.

  \param[in] router - parameters is used if tree addressing is active.
  \param[in] addrRequested - if rejoin is used, it is address device selects for
     itself otherwise NWK_NO_SHORT_ADDR.
  \param[in] extAddr - IEEE extended address of node.
  \return Allocated address. addrRequested - is possible,
          or address allocated in little endian.
 ******************************************************************************/
NWK_PRIVATE ShortAddr_t nwkAllocateShortAddr(const bool router,
  const ShortAddr_t addrRequested, const ExtAddr_t extAddr);
#endif /* _COORDINATOR_ or _ROUTER_ */

#if defined _NWK_DISTRIBUTED_ADDRESSING_
/**************************************************************************//**
  \brief Computing the size of the address sub-block.

  \param[in] depth - current depth of node in network tree topology.
  \return cskip block in big endian format.
 ******************************************************************************/
NWK_PRIVATE NwkAddrRange_t nwkCSkip(const NwkDepth_t depth);
#endif /* _NWK_DISTRIBUTED_ADDRESSING_ */

/**************************************************************************//**
  \brief Allocate non-conflict short address

  \param[in] shortAddr - initial value of short address.
  \param[in] extAddr - pointer to IEEE extended address of node for which is
                       allocated a short address.
  \return Valid short address in little endian format.
 ******************************************************************************/
NWK_PRIVATE ShortAddr_t nwkAllocNonConflAddr(ShortAddr_t shortAddr,
  const ExtAddr_t *const extAddr);

/**************************************************************************//**
  \brief Is received broadcast packet for this device or not?

  \param[in] dstAddr - destination broadcast address.

  \return 'true' if broadcast packet can be handled by this device
          otherwise return 'false'.
 ******************************************************************************/
NWK_PRIVATE bool nwkBroadcastForMe(const ShortAddr_t dstAddr);

#endif /* _NWK_ADDRESS_H */
/** eof nwkAddress.h */