summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclOtauDiscovery.h
blob: 54365690ec3bbdfcc849eba3b09236098677f920 (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
/**************************************************************************//**
  \file zclOTAUCluster.h

  \brief Declaration of the private OTAU interface

  \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:
    13.05.10 A. Khromykh - Created.
*******************************************************************************/
#ifndef _ZCLOTAUDISCOVERY_H
#define _ZCLOTAUDISCOVERY_H

/******************************************************************************
                        Includes section
******************************************************************************/
#include <zcl.h>
#include <clusters.h>
#include <zdo.h>

/******************************************************************************
                           Types section
******************************************************************************/
typedef union
{
  ZDO_ZdpReq_t          zdpOtauReq;
#ifdef _ZCL_SECURITY_
  APS_RequestKeyReq_t   apsKeyReq;
#endif // _ZCL_SECURITY_
  ZCL_Request_t         zclCommandReq;
} OtauReqMemory_t;

typedef union
{
  ZCL_OtauQueryNextImageReq_t   uQueryNextImageReq;
  ZCL_OtauImageBlockReq_t       uImageBlockReq;
  ZCL_OtauImagePageReq_t        uImagePageReq;
  ZCL_OtauUpgradeEndReq_t       uUpgradeEndReq;
} OtauZclReqMemory_t;

typedef struct
{
  uint32_t  imageInternalLength;
  uint8_t   internalAddressStatus;
  uint32_t  currentFileOffset;
  uint8_t   currentDataSize;
  uint32_t  imageRemainder;
  uint32_t  imagePageOffset;
} OtauImageAuxVar_t;

/***************************************************************************//**
  \brief
  ZCL OTAU Cluster parametres.
*******************************************************************************/
typedef struct
{
  uint32_t        imageSize;
  uint8_t         imageBlockData[OFD_BLOCK_SIZE];
  uint8_t        *imagePageData;

} ZclOtauClientImageBuffer_t;

/******************************************************************************
                   Prototypes section
******************************************************************************/
/***************************************************************************//**
\brief Restart poll timer

\param[in] period - timer fired time
\param[in] cb     - pointer to fired method
******************************************************************************/
void otauStartGenericTimer(uint32_t period, void (* cb)(void));

/***************************************************************************//**
\brief Restart discovery service with context gap
******************************************************************************/
void otauStartPollDiscovery(void);

/***************************************************************************//**
\brief Entry point to client process
******************************************************************************/
void otauClientEntryPoint(void);

/***************************************************************************//**
\brief Start discovery of upgrade server
******************************************************************************/
void ZCL_OtauUpgradeServerDiscovery(void);

/***************************************************************************//**
\brief Server IEEE addresses request
******************************************************************************/
void otauServerExtAddrReq(void);

#endif /* _ZCLOTAUDISCOVERY_H */