Tizen RT Libs&Environment  v1.1 D4
fota_hal.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright 2016 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  ****************************************************************************/
18 #ifndef __APPS_INCLUDE_SYSTEM_FOTA_HAL_H
19 #define __APPS_INCLUDE_SYSTEM_FOTA_HAL_H
20 /****************************************************************************
21 * Included Files
22 ****************************************************************************/
23 
24 /****************************************************************************
25 * Pre-processor Definitions
26 ****************************************************************************/
27 
28 /****************************************************************************
29 * Public Types
30 ****************************************************************************/
31 #ifndef __ASSEMBLY__
36 };
37 
39 
41  uint32_t fotahal_magic;
42  uint32_t fotahal_bin_id;
44  uint32_t fotahal_bin_size;
45  uint32_t fotahal_bin_reserved[3];
46  uint32_t fotahal_checksum;
47 };
48 
50 
66 };
67 
69 
70 typedef void *fotahal_handle_t;
71 
72 /****************************************************************************
73 * Public Data
74 ****************************************************************************/
75 #ifdef __cplusplus
76 #define EXTERN extern "C"
77 extern "C" {
78 #else
79 #define EXTERN extern
80 #endif
81 /****************************************************************************
82 * Inline Functions
83 ****************************************************************************/
84 /****************************************************************************
85 * Public Function Prototypes
86 ****************************************************************************/
87 /****************************************************************************
88  * Name: fotahal_open
89  *
90  * Description:
91  * open fotahal layer
92  ****************************************************************************/
94 
95 /****************************************************************************
96  * Name: fotahal_get_partition
97  *
98  * Description:
99  * Get current running partition id
100  * Return -1 on failure, on Success return part_id
101  ****************************************************************************/
103 
104 /****************************************************************************
105  * Name: fotahal_set_partition
106  *
107  * Description:
108  * Set a new partition for fota write
109  ****************************************************************************/
111 
112 /****************************************************************************
113  * Name: fotahal_set_binary
114  *
115  * Description:
116  * Set a binary type for fota write
117  ****************************************************************************/
118 fotahal_return_t fotahal_set_binary(fotahal_handle_t handle, uint32_t bin_id);
119 
120 /****************************************************************************
121  * Name: fotahal_write
122  *
123  * Description:
124  * write binary chunck in buffer to fota partition
125  ****************************************************************************/
126 fotahal_return_t fotahal_write(fotahal_handle_t handle, const char *buffer, uint32_t bin_size);
127 
128 /****************************************************************************
129  * Name: fotahal_update_bootparam
130  *
131  * Description:
132  * Update boot param
133  ****************************************************************************/
135 
136 /****************************************************************************
137  * Name: fotahal_close
138  *
139  * Description:
140  * close fotahal
141  ****************************************************************************/
143 #undef EXTERN
144 #ifdef __cplusplus
145 }
146 #endif /* __cplusplus */
147 #endif /* __ASSEMBLY__ */
148 #endif /* __APPS_INCLUDE_SYSTEM_FOTA_HAL_H */
uint32_t fotahal_bin_reserved[3]
Definition: fota_hal.h:45
fotahal_handle_t fotahal_open(void)
fotahal_return_t fotahal_update_bootparam(fotahal_handle_t handle)
fotahal_return_t fotahal_close(fotahal_handle_t handle)
uint32_t fotahal_bin_id
Definition: fota_hal.h:42
fotahal_return_t fotahal_write(fotahal_handle_t handle, const char *buffer, uint32_t bin_size)
fotahal_return_t fotahal_set_partition(fotahal_handle_t handle, fota_partition_id_t part_id)
uint32_t fotahal_checksum
Definition: fota_hal.h:46
enum fota_partition_id_s fota_partition_id_t
Definition: fota_hal.h:38
uint32_t fotahal_magic
Definition: fota_hal.h:41
uint32_t fotahal_bin_partaddr
Definition: fota_hal.h:43
void * fotahal_handle_t
Definition: fota_hal.h:70
fota_partition_id_t fotahal_get_partition(fotahal_handle_t handle)
fota_partition_id_s
Definition: fota_hal.h:32
enum fotahal_return_e fotahal_return_t
Definition: fota_hal.h:68
fotahal_return_t fotahal_set_binary(fotahal_handle_t handle, uint32_t bin_id)
fotahal_return_e
Definition: fota_hal.h:51
uint32_t fotahal_bin_size
Definition: fota_hal.h:44