summaryrefslogtreecommitdiffhomepage
path: root/digital/zigbit/bitcloud/stack/Components/HAL/drivers/include/isdImageStorage.h
blob: c56311892cd1490db1d9dff03ed4a1864db0aac6 (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
/**************************************************************************//**
\file   isdImageStorage.h

\brief  The public API of image storage driver.

\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:
    25.05.11 A. Khromykh - Created
*******************************************************************************/

#ifndef _ISDIMAGESTORAGE_H
#define _ISDIMAGESTORAGE_H

/******************************************************************************
                   Includes section
******************************************************************************/
#include <types.h>
#include <zclOTAUCluster.h>

/******************************************************************************
                   Define(s) section
******************************************************************************/

/******************************************************************************
                   Types section
******************************************************************************/
/** \brief Status which is returned by driver */
typedef enum
{
  ISD_SUCCESS,
  ISD_HARDWARE_FAULT,
  ISD_COMMUNICATION_LOST
} ISD_Status_t;

typedef void (* IsdOpenCb_t)(ISD_Status_t);
typedef void (* IsdQueryNextImageCb_t)(ZCL_OtauQueryNextImageResp_t *);
typedef void (* IsdImageBlockCb_t)(ZCL_OtauImageBlockResp_t *);
typedef void (* IsdUpgradeEndCb_t)(ZCL_OtauUpgradeEndResp_t *);

/******************************************************************************
                   Prototypes section
******************************************************************************/
/**************************************************************************//**
\brief Open image storage driver

\param[in] cb - callback about driver actions
******************************************************************************/
void ISD_Open(IsdOpenCb_t cb);

/**************************************************************************//**
\brief Close image storage driver
******************************************************************************/
void ISD_Close(void);

/**************************************************************************//**
\brief Send query next image request to storage system

\param[in] addressing - pointer to structure that include client network information; \n
\param[in] data - data payload; \n
\param[in] cd - callback about response receiving from storage system.
******************************************************************************/
void ISD_QueryNextImageReq(ZCL_Addressing_t *addressing, ZCL_OtauQueryNextImageReq_t *data, IsdQueryNextImageCb_t cb);

/**************************************************************************//**
\brief Send image block request to storage system

\param[in] addressing - pointer to structure that include client network information; \n
\param[in] data - data payload; \n
\param[in] cd - callback about response receiving from storage system.
******************************************************************************/
void ISD_ImageBlockReq(ZCL_Addressing_t *addressing, ZCL_OtauImageBlockReq_t *data, IsdImageBlockCb_t cb);

/**************************************************************************//**
\brief Send upgrade end request to storage system

\param[in] addressing - pointer to structure that include client network information; \n
\param[in] data - data payload; \n
\param[in] cd - callback about response receiving from storage system.
******************************************************************************/
void ISD_UpgradeEndReq(ZCL_Addressing_t *addressing, ZCL_OtauUpgradeEndReq_t *data, IsdUpgradeEndCb_t cb);

#endif /* _ISDIMAGESTORAGE_H */