1 Star 0 Fork 1

AmumuI/swupdate_progress

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
progress_ipc.h 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
xiefu 提交于 2024-09-05 11:20 +08:00 . first commit.
/*
* Author: Christian Storm
* Copyright (C) 2017, Siemens AG
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#ifndef _PROGRESS_IPC_H
#define _PROGRESS_IPC_H
#include <stdbool.h>
#include <swupdate_status.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PRINFOSIZE 2048
extern char* SOCKET_PROGRESS_PATH;
/*
* Message sent via progress socket.
* Data is sent in LE if required.
*/
struct progress_msg {
unsigned int magic; /* Magic Number */
RECOVERY_STATUS status; /* Update Status (Running, Failure) */
unsigned int dwl_percent; /* % downloaded data */
unsigned long long dwl_bytes; /* total of bytes to be downloaded */
unsigned int nsteps; /* No. total of steps */
unsigned int cur_step; /* Current step index */
unsigned int cur_percent; /* % in current step */
char cur_image[256]; /* Name of image to be installed */
char hnd_name[64]; /* Name of running hanler */
sourcetype source; /* Interface that triggered the update */
unsigned int infolen; /* Len of data valid in info */
char info[PRINFOSIZE]; /* additional information about install */
};
char *get_prog_socket(void);
/* Standard function to connect to progress interface */
int progress_ipc_connect(bool reconnect);
/*
* In case more as an instance of SWUpdate is running, this allows to select
* which should be taken
*/
int progress_ipc_connect_with_path(const char *socketpath, bool reconnect);
/* Retrieve messages from progress interface (it blocks) */
int progress_ipc_receive(int *connfd, struct progress_msg *msg);
#ifdef __cplusplus
} // extern "C"
#endif
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/AmumuL/swupdate_progress.git
git@gitee.com:AmumuL/swupdate_progress.git
AmumuL
swupdate_progress
swupdate_progress
master

搜索帮助