Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sol-update.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Soletta (TM) Project
3  *
4  * Copyright (C) 2015 Intel Corporation. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #pragma once
20 
21 #include "sol-str-slice.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
62 struct sol_update_handle;
64 
70 typedef struct sol_update_info {
71 #ifndef SOL_NO_API_VERSION
72 #define SOL_UPDATE_INFO_API_VERSION (1)
73  uint16_t api_version;
74 #endif
75  const char *version;
76  uint64_t size;
77  bool need_update;
79 
97  void (*cb)(void *data, int status, const struct sol_update_info *response),
98  const void *data);
99 
120 struct sol_update_handle *sol_update_fetch(void (*cb)(void *data, int status),
121  const void *data, bool resume);
122 
139 struct sol_update_handle *sol_update_install(void (*cb)(void *data, int status),
140  const void *data);
141 
155 bool sol_update_cancel(struct sol_update_handle *handle);
156 
168 int sol_update_get_progress(struct sol_update_handle *handle);
169 
173 #ifdef __cplusplus
174 }
175 #endif
bool sol_update_cancel(struct sol_update_handle *handle)
Cancel an ongoing check, fetch or install task.
const char * version
Current version of update file.
Definition: sol-update.h:75
int sol_update_get_progress(struct sol_update_handle *handle)
Get progress of given update task.
Contains update info got via sol_update_check call.
Definition: sol-update.h:70
struct sol_update_handle * sol_update_check(void(*cb)(void *data, int status, const struct sol_update_info *response), const void *data)
Check if there's an update to get.
uint64_t size
Size of update file.
Definition: sol-update.h:76
struct sol_update_handle * sol_update_fetch(void(*cb)(void *data, int status), const void *data, bool resume)
Fetch update, so it can be installed later wit sol_update_install.
bool need_update
If version of update is newer than current, so the update is necessary.
Definition: sol-update.h:77
uint16_t api_version
Definition: sol-update.h:73
struct sol_update_handle * sol_update_install(void(*cb)(void *data, int status), const void *data)
Install update.
These are routines that Soletta provides for its string slice implementation.
struct sol_update_handle sol_update_handle
Handle returned by some sol_update* calls, so they can be cancelled appropriately.
Definition: sol-update.h:63
struct sol_update_info sol_update_info
Contains update info got via sol_update_check call.