blob: 732c06a8bfe3f2b6e52c32945c108675d7da3af9 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001
2#ifndef LIB_ZTE_DMAPP_H
3#define LIB_ZTE_DMAPP_H
4
5#include "fota_common.h"
6
7
8// fotaflag ±éÀúÓú궨Òå
9#define ZTE_DUA_FOTAFLAG_PART "/device/name"
10#define ZTE_DUA_FOTAFLAG "fotaflag"
11#define ZTE_DUA_PART_UPDATED_DEV "/dev"
12#define ZTE_DUA_FOTAFLAG_BLOCK_PART "/sys/class/block"
13#define ZTE_FOTA_FLAG_PART_NAME_MAX_LEN 255
14
15
16/**************************************************************************
17* Êý¾ÝÀàÐÍ *
18**************************************************************************/
19/* webui֪ͨdmÄ£¿éµÄÏûÏ¢¶¨Òå */
20typedef enum {
21 DM_WEBUI_START_FOTA = 0,//·¢Æð¸üÐÂ
22 DM_WEBUI_PARAM_CHANGED//ÐÞ¸ÄÁ˲ÎÊý
23
24} E_WebUINotifyType;
25
26/* Ö÷¿ØÍ¨ÖªdmÄ£¿éÊÇ·ñÓÐÊý¾ÝÒµÎñµÄÏûÏ¢¶¨Òå */
27typedef enum {
28 DM_HAS_DTA_COMM = 0,//µ±Ç°ÓÐÓû§Êý¾ÝÁ÷Á¿
29 DM_HAS_NO_DTA_COMM//ÎÞ
30} E_MCDataRes;
31
32/* Ö÷¿ØÍ¨ÖªdmÄ£¿éÊÇ·ñÓÐÊý¾ÝÒµÎñµÄÏûÏ¢¶¨Òå */
33typedef enum {
34 DM_BSP_PRO_OK = 0,//³É¹¦
35 DM_BSP_PRO_FAILED
36} E_BSPProcRes;
37
38/* Ö÷¿ØÍ¨ÖªdmÄ£¿éÉ豸˯Ãߺͻ½ÐÑ*/
39typedef enum DeviceSleepWakeUpState_tag {
40 DM_WAKE_UP_OK = 0,//»½Ðѳɹ¦
41 DM_FALL_ASLEEP_OK = 1, //»½ÐÑʧ°Ü
42} DeviceSleepWakeUpState ;
43
44
45#define DMAPP_IF_ACTIVATE_PDP 0x0001
46
47typedef struct {
48 int cmd;
49 char data[256];
50} DmApp_IF_CMD;
51
52/**************************************************************************
53* È«¾Öº¯ÊýÔ­ÐÍ *
54**************************************************************************/
55/**
56* @brief ֪ͨDMÖ÷¿ØÇл»APNµÄ½á¹û
57* @param int result
58* @param char * reason ʧ°ÜµÄÔ­Òò,ÔÝ䶨Òå
59* @return 1--³É¹¦ 0--·¢Éú´íÎó
60*/
61int Zte_DmApp_IF_MCNotifyAPNResult(int result, char * reason);
62
63/**
64* @brief WebUI֪ͨDM
65* @param eType ֪ͨʼþ
66* @return 1--³É¹¦ 0--·¢Éú´íÎó
67*/
68int Zte_DmApp_IF_WebUINotifyDM(E_WebUINotifyType eType);
69
70/**
71* @brief MC֪ͨDMÊÇ·ñÓÐÊý¾ÝÒµÎñÕýÔÚ½øÐÐ
72* @param eRes ÊÇ·ñÓÐÊý¾ÝÒµÎñ
73* @return 1--³É¹¦ 0--·¢Éú´íÎó
74*/
75
76int Zte_DmApp_IF_MCNotifyDataResult(E_MCDataRes eRes);
77/**
78* @brief BSP֪ͨDMÆä²Ù×÷½á¹û
79* @param eRes ÊÇ·ñ²Ù×÷³É¹¦
80* @return 1--³É¹¦ 0--·¢Éú´íÎó
81*/
82int Zte_DmApp_IF_BSPNotifyProResult(E_BSPProcRes eRes);
83
84/**
85* @brief MC֪ͨDM»½ÐÑÉ豸²Ù×÷½á¹û
86* @param eRes ÊÇ·ñ²Ù×÷³É¹¦
87* @return 1--³É¹¦ 0--·¢Éú´íÎó
88*/
89int Zte_DmApp_IF_McNotifyDeviceSleepWakeUpState(DeviceSleepWakeUpState sleepWakeUpState);
90
91
92typedef enum DevicePowerState_tag {
93 DEVICE_IS_POWER_ON = 0, //É豸¿ª»ú
94 DEVICE_IS_NOT_POWER_ON,//É豸먦»ú
95} DevicePowerState;
96
97/**
98* @brief MC֪ͨDM½øÈ뿪»ú״̬
99* @param eRes ÊÇ·ñ²Ù×÷³É¹¦
100* @return 1--³É¹¦ 0--·¢Éú´íÎó
101*/
102int Zte_DmApp_IF_McNotifyDevicePowerOn(DevicePowerState devicePowerState);
103
104
105/**
106* @brief ˯ÃßÄ£¿é֪ͨDMÄ£¿é½øÈë˯Ãßģʽ
107* @param eRes ÊÇ·ñ²Ù×÷³É¹¦
108* @return 1--³É¹¦ 0--·¢Éú´íÎó
109*/
110
111int Zte_DmApp_IF_SleepModuleNotifyDmToSleep(void);
112
113int zte_fota_browse_fotaflag(char *pathname, char *fota_flag_part_name, unsigned int len);
114int zte_fota_set_updateflag(char *updateflag);
115char* zte_fota_get_updateflag(char *updateflag_buf);
116int zte_fota_set_stateflag(stateflag_t stateflag);
117int zte_fota_get_stateflag();
118stateflag_t translate_stateflag_str_to_flag(char *stateflag_str);
119char* translate_stateflag_flag_to_str(stateflag_t stateflag);
120int zte_fota_set_netdogflag(int index, int value);
121int zte_fota_get_netdogflag_single(int index);
122char* zte_fota_get_netdogflag_all(char *netdogflag_buf);
123
124int Zte_DmApp_IF_GetVersionStatus(void);
125int Zte_DmApp_IF_GetCurOps(void);
126int Zte_DmApp_IF_GetUpdateCmd(void);
127int Zte_DmApp_IF_SetUpdateCmd(int cmd);
128int Zte_DmApp_IF_GetDLProgress(int *totalSize, int *downloadSize);
129int Zte_DmApp_IF_GetFotaPkgInfo(int *totalSize, char *pkgName, char *pkgVer, char *pkgDesc);
130int Zte_DmApp_IF_GetUpdateResult(void);
131int Zte_DmApp_IF_GetUpdateSettings(int *mode, int *interval, int *enableRoaming);
132int Zte_DmApp_IF_SetUpdateSettings(int mode, int interval, int enableRoaming);
133#endif