summaryrefslogtreecommitdiff
path: root/digital/beacon/src/Bitcloud_stack/Components/ZCL/include/private/zclDbg.h
blob: 4468efa41a0d7ec4f64b651e09b2bb1cde2393e6 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/************************************************************************//**
  \file zclDbg.h

  \brief
    The header file describes ZCL Debug Module

    The file describes the ZCL Debug Module

  \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:
    02.12.08 A. Poptashov - Created.
******************************************************************************/

#ifndef _ZCLDBG_H
#define _ZCLDBG_H

/******************************************************************************
                   Includes section
******************************************************************************/
#include <dbg.h>

/******************************************************************************
                   Define(s) section
******************************************************************************/
#if defined _SYS_ASSERT_ON_

#define  ZCL_SET_STATE(state, newState)  (state) = (newState)
#define  ZCL_CHECK_STATE(state, checkState, nameOfAssert) \
  assert((checkState) == (state), nameOfAssert)

#else /* _SYS_ASSERT_ON_ */

#define  ZCL_SET_STATE(state, newState)
#define  ZCL_CHECK_STATE(state, waitState, nameOfAssert)
#if defined assert
#undef assert
#endif /* assert */
#define  assert(condition, dbgCode)  (void)0

#endif /* _SYS_ASSERT_ON_ */

/******************************************************************************
                   Types section
******************************************************************************/

/******************************************************************************
                   Constants section
******************************************************************************/
typedef enum
{
  /***********************************
    ZCL section. Range 0x8000 - 0x8fff
  ************************************/

  //ZCL Task Manager Id       (0x8000 - 0x80ff)
  ZCLTASKMANAGER_TASKHANDLER_0 = 0x8000,
  //ZCL CAPS Id               (0x8100 - 0x81ff)

  //ZCL ZCL Id                (0x8200 - 0x82ff)
  ZCLGETCLUSTER_0 = 0x8200,
  PARSEDATAIND_0  = 0x8201,
  ZCLREPORTIND_0  = 0x8202,
  DBG_ZCL_GET_TRUST_CENTER_ADDRESS = 0x8203,
  ZCL_UNDEFINED_CLUSTER_IN_REQUEST = 0x8204,
  ZCL_UNEXPECTED_ASDU_LENGTH       = 0x8205,
  UNKNOWN_DAT_TYPE_DESCR           = 0x8206,
  //ZCL Memory Manager        (0x8300 - 0x83ff)
  ZCL_DATAIND_0 = 0x8300,
  ZCL_THERE_ARE_NO_BUFFERS = 0x8301,
  //OTAU                      (0x8400 - 0x84ff)
  ZCL_OTAU_NULL_POINTER_TO_INIT_STRUCTURE = 0x8400,
  ZCL_OTAU_DOUBLE_START                   = 0x8401,
  ZCL_OTAU_UNEXPECTED_SERVER_DISCOVERY    = 0x8402,
  ZCL_UNKNOWN_CUSTOM_MESSAGE              = 0x8403,
  ZCL_OTAU_UNKNOWN_SERVER_TRANSACTUION_ID = 0x8404,
  ZCL_UNKNOWN_ISD_MESSAGE                 = 0x8405,
  // KE
  KE_WRONG_STATE_0 = 0x8500,
  KE_WRONG_STATE_1 = 0x8501,
  KE_WRONG_STATE_2 = 0x8502,
  KE_WRONG_STATE_3 = 0x8503,
  KE_WRONG_STATE_4 = 0x8504,
  KE_WRONG_STATE_5 = 0x8505,

  ZCL_MEMORY_CORRUPTION_0 = 0x8600,
  ZCL_MEMORY_CORRUPTION_1 = 0x8601,
  ZCL_MEMORY_CORRUPTION_2 = 0x8602,
  ZCL_MEMORY_CORRUPTION_3 = 0x8603
} ZclDbgCodeId_t;

typedef enum
{
  OTAU_STOPPED_STATE,
  OTAU_STARTED_STATE,
  OTAU_OFD_INITIALIZATION_STATE,
  OTAU_BROADCAST_MATCH_DESC_REQ,
  OTAU_UNICAST_MATCH_DESC_REQ,
  OTAU_SHORT_ADDR_REQ,
  OTAU_EXT_ADDR_REQ,
  OTAU_GET_TRUST_CENTRE_ADDR,
  OTAU_GET_LINK_KEY,
  OTAU_QUERY_NEXT_IMAGE_TRANSAC,
  OTAU_WAITING_FOR_SERVER_DISCOVERY,
  OTAU_ERASE_IMAGE,
  OTAU_IMAGE_BLOCK_TRANSAC,
  OTAU_IMAGE_PAGE_TRANSAC,
  OTAU_WRITE_DATA_TO_FLASH,
  OTAU_FLUSH_DATA_TO_FLASH,
  OTAU_UPGRADE_END_TRANSAC,
  OTAU_WAITING_FOR_UPGRADE_TIMEOUT,
  OTAU_WAITING_FOR_UPGRADE_UNLIMITED,
  OTAU_SWITCH_IMAGE
} ZclOtauStateMachine_t;

/******************************************************************************
                   External variables section
******************************************************************************/

/******************************************************************************
                   Prototypes section
******************************************************************************/

/******************************************************************************
                   Inline static functions section
******************************************************************************/


#endif  //#ifndef _ZCLDBG_H

//eof zclDbg.h