summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/NWK/include/private/nwkBTT.h
blob: 881b5576fdd75c60da8105be4337fde5e880d4f0 (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
83
84
85
86
/**************************************************************************//**
  \file nwkBTT.h

  \brief Broadcast transaction table.

  \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:
    2007-09-01 V. Panov - Created.
    2008-11-17 M. Gekk - Correct clearing of record in BTT. In case of overflow
                       of the table function nwkCheckBTT returns an error.
                       BTT moved in ConfigServer.
    2009-04-29 M. Gekk - Refactoring.
    2009-11-24 Igor Vagulin - reimplemented using sysDuplicateTable.
   Last change:
    $Id: nwkBTT.h 17946 2011-07-13 09:26:59Z mgekk $
 ******************************************************************************/
#if !defined _NWK_BTT_H
#define _NWK_BTT_H

/******************************************************************************
                                Includes section
 ******************************************************************************/
#include <nwkConfig.h>
#include <mac.h>
#include <sysDuplicateTable.h>

/******************************************************************************
                                 Types section
 ******************************************************************************/
/** Broadcast transaction table */
typedef struct _NwkBTT_t
{
  /** Pointer to BTT sysDuplicateTable descriptor */
  SYS_DuplicateTable_t btt;
} NwkBTT_t;

/******************************************************************************
                             Prototypes section
 ******************************************************************************/
/**************************************************************************//**
  \brief Reseting of the broadcast transaction table.
 ******************************************************************************/
NWK_PRIVATE void nwkResetBTT(void);

/**************************************************************************//**
  \brief Check entry for short address and sequence number.

  \param[in] shortAddr - source address of broadcast packet.
  \param[in] sequenceNumber - a sequence number of broadcast packet.
 ******************************************************************************/
NWK_PRIVATE SysDuplicateTableAnswer_t nwkCheckBTT(const ShortAddr_t shortAddr,
  const uint8_t sequenceNumber);

/**************************************************************************//**
  \brief Clear the existing entry in the broadcast transaction table.

  \param[in] shortAddr - a short address of broadcast packet,
  \param[in] sequenceNumber - a sequence number of broadcast packet.

  \return None.
 ******************************************************************************/
NWK_PRIVATE void nwkClearBTR(const ShortAddr_t shortAddr,
  const uint8_t sequenceNumber);

/**************************************************************************//**
  \brief Add new BTR to BTT with own address and given sequence number

  \param[in] sequenceNumber - a sequence number of broadcast packet.
  \return None.
 ******************************************************************************/
#if !defined NWK_ALWAYS_REJECT_OWN_BROADCAST
NWK_PRIVATE void nwkAddOwnBTR(const uint8_t sequenceNumber);

#else
#define nwkAddOwnBTR(sequenceNumber) (void)0
#endif /* NWK_ALWAYS_REJECT_OWN_BROADCAST */
#endif /* _NWK_BTT_H */
/** eof nwkBTT.h */