source: svn/newcon3bcm2_21bu/nexus/app/dta/image_recv.h @ 22

Last change on this file since 22 was 22, checked in by phkim, 11 years ago
  1. phkim
  2. newcon3sk 를 kctv 로 브랜치 함
  • Property svn:executable set to *
File size: 4.3 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2008, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: $
11 * $brcm_Revision: $
12 * $brcm_Date: $
13 *
14 * Module Description:
15 *
16 * Revision History:
17 *
18 * $brcm_Log: $
19 *
20 *
21 ***************************************************************************/
22#if !defined(__IMAGE_RECV_H__)
23#define __IMAGE_RECV_H__
24
25#include "bapp_types.h"
26
27/***************************************************************************
28Summary:
29 Error codes returned by image functions
30Description:
31 Error codes that are returned by image... functions. Caller must test
32these error codes and update status accordingly.
33***************************************************************************/
34#define berr_no_dsmcc_pid 41
35#define berr_no_code_image_file 42
36#define berr_download_failure 43
37#define berr_no_memory 44
38#define berr_verification_falure 45
39#define berr_loading 46
40#define berr_same_version 47
41
42/***************************************************************************
43Summary:
44 Structure describing received software image in memory.
45Description:
46 Structure is placed at the head of received image.
47 size - size of the image.
48 data - content of the software image. The actual array has at least as many
49 bytes as the size of the image. The remaining bytes follow the first element
50 of the array - data[1], data[2]...
51***************************************************************************/
52struct image_t {
53    size_t size;
54    char data[1];
55};
56
57/***************************************************************************
58Summary:
59  Initialize image download.
60Description:
61  Initialize image download and prepare for receiving image. This function
62should be called before calling any other function. There is no corresponding
63close function.
64Input:
65  None
66Output:
67  None
68Returns:
69  b_ok in case call was successful, error code otherwise.
70SeeAlso:
71None
72***************************************************************************/
73bresult image_init(void);
74
75/***************************************************************************
76Summary:
77  Receive image from the dsmcc carousel
78Description:
79  Receive image from the dsmcc carousel. The function first receives dii,
80parses it, then receives first module described in dii. The result is stored
81in memory block described by image_t structure and allocated inside of the
82function. After caller is done with the image it must call free(image) in
83order to avoid memory leak. Since image is large memory leak will be
84significant. Function does not do any tuning so tuning should be done before
85calling this function.
86Input:
87  band - input band on which to receive data.
88  pid - pid which contains dsm-cc data.
89  image - pointer to pointer to the image structure.
90  name_lengh - lenght of name from CVT
91  name - pointer to the name from CVT
92Output:
93  image - if function is successful this pointer will be initialize with
94pointer to the image_t structure containing received image. If function
95fails content of this pointer is not defined. After application is done with
96data the this pointer should be freed by calling free.
97Returns:
98  b_ok if function is successful error code otherwise.
99SeeAlso:
100  image_init
101***************************************************************************/
102bresult image_receive(bband_t band, uint16_t pid, struct image_t ** image, uint8_t name_length, uint8_t * name);
103
104/***************************************************************************
105Summary:
106  Write image to flash
107Description:
108  Function chooses which location to use for storing image based on image
109version and running image version. Then function authenticates image and
110if authentication successful, writes image to flash.
111Input:
112  image - pointer to the image structure.
113Output:
114  None
115Returns:
116  b_ok if function is successful error code otherwise.
117SeeAlso:
118  image_init, image_receive
119***************************************************************************/
120bresult image_write(struct image_t * image);
121
122#endif
Note: See TracBrowser for help on using the repository browser.