lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | |
| 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Ä£¿éµÄÏûÏ¢¶¨Òå */ |
| 20 | typedef enum { |
| 21 | DM_WEBUI_START_FOTA = 0,//·¢Æð¸üР|
| 22 | DM_WEBUI_PARAM_CHANGED//ÐÞ¸ÄÁ˲ÎÊý |
| 23 | |
| 24 | } E_WebUINotifyType; |
| 25 | |
| 26 | /* Ö÷¿ØÍ¨ÖªdmÄ£¿éÊÇ·ñÓÐÊý¾ÝÒµÎñµÄÏûÏ¢¶¨Òå */ |
| 27 | typedef enum { |
| 28 | DM_HAS_DTA_COMM = 0,//µ±Ç°ÓÐÓû§Êý¾ÝÁ÷Á¿ |
| 29 | DM_HAS_NO_DTA_COMM//ÎÞ |
| 30 | } E_MCDataRes; |
| 31 | |
| 32 | /* Ö÷¿ØÍ¨ÖªdmÄ£¿éÊÇ·ñÓÐÊý¾ÝÒµÎñµÄÏûÏ¢¶¨Òå */ |
| 33 | typedef enum { |
| 34 | DM_BSP_PRO_OK = 0,//³É¹¦ |
| 35 | DM_BSP_PRO_FAILED |
| 36 | } E_BSPProcRes; |
| 37 | |
| 38 | /* Ö÷¿ØÍ¨ÖªdmÄ£¿éÉ豸˯Ãߺͻ½ÐÑ*/ |
| 39 | typedef 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 | |
| 47 | typedef 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 | */ |
| 61 | int Zte_DmApp_IF_MCNotifyAPNResult(int result, char * reason); |
| 62 | |
| 63 | /** |
| 64 | * @brief WebUI֪ͨDM |
| 65 | * @param eType ֪ͨʼþ |
| 66 | * @return 1--³É¹¦ 0--·¢Éú´íÎó |
| 67 | */ |
| 68 | int Zte_DmApp_IF_WebUINotifyDM(E_WebUINotifyType eType); |
| 69 | |
| 70 | /** |
| 71 | * @brief MC֪ͨDMÊÇ·ñÓÐÊý¾ÝÒµÎñÕýÔÚ½øÐÐ |
| 72 | * @param eRes ÊÇ·ñÓÐÊý¾ÝÒµÎñ |
| 73 | * @return 1--³É¹¦ 0--·¢Éú´íÎó |
| 74 | */ |
| 75 | |
| 76 | int Zte_DmApp_IF_MCNotifyDataResult(E_MCDataRes eRes); |
| 77 | /** |
| 78 | * @brief BSP֪ͨDMÆä²Ù×÷½á¹û |
| 79 | * @param eRes ÊÇ·ñ²Ù×÷³É¹¦ |
| 80 | * @return 1--³É¹¦ 0--·¢Éú´íÎó |
| 81 | */ |
| 82 | int Zte_DmApp_IF_BSPNotifyProResult(E_BSPProcRes eRes); |
| 83 | |
| 84 | /** |
| 85 | * @brief MC֪ͨDM»½ÐÑÉ豸²Ù×÷½á¹û |
| 86 | * @param eRes ÊÇ·ñ²Ù×÷³É¹¦ |
| 87 | * @return 1--³É¹¦ 0--·¢Éú´íÎó |
| 88 | */ |
| 89 | int Zte_DmApp_IF_McNotifyDeviceSleepWakeUpState(DeviceSleepWakeUpState sleepWakeUpState); |
| 90 | |
| 91 | |
| 92 | typedef 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 | */ |
| 102 | int Zte_DmApp_IF_McNotifyDevicePowerOn(DevicePowerState devicePowerState); |
| 103 | |
| 104 | |
| 105 | /** |
| 106 | * @brief ˯ÃßÄ£¿é֪ͨDMÄ£¿é½øÈë˯Ãßģʽ |
| 107 | * @param eRes ÊÇ·ñ²Ù×÷³É¹¦ |
| 108 | * @return 1--³É¹¦ 0--·¢Éú´íÎó |
| 109 | */ |
| 110 | |
| 111 | int Zte_DmApp_IF_SleepModuleNotifyDmToSleep(void); |
| 112 | |
| 113 | int zte_fota_browse_fotaflag(char *pathname, char *fota_flag_part_name, unsigned int len); |
| 114 | int zte_fota_set_updateflag(char *updateflag); |
| 115 | char* zte_fota_get_updateflag(char *updateflag_buf); |
| 116 | int zte_fota_set_stateflag(stateflag_t stateflag); |
| 117 | int zte_fota_get_stateflag(); |
| 118 | stateflag_t translate_stateflag_str_to_flag(char *stateflag_str); |
| 119 | char* translate_stateflag_flag_to_str(stateflag_t stateflag); |
| 120 | int zte_fota_set_netdogflag(int index, int value); |
| 121 | int zte_fota_get_netdogflag_single(int index); |
| 122 | char* zte_fota_get_netdogflag_all(char *netdogflag_buf); |
| 123 | |
| 124 | int Zte_DmApp_IF_GetVersionStatus(void); |
| 125 | int Zte_DmApp_IF_GetCurOps(void); |
| 126 | int Zte_DmApp_IF_GetUpdateCmd(void); |
| 127 | int Zte_DmApp_IF_SetUpdateCmd(int cmd); |
| 128 | int Zte_DmApp_IF_GetDLProgress(int *totalSize, int *downloadSize); |
| 129 | int Zte_DmApp_IF_GetFotaPkgInfo(int *totalSize, char *pkgName, char *pkgVer, char *pkgDesc); |
| 130 | int Zte_DmApp_IF_GetUpdateResult(void); |
| 131 | int Zte_DmApp_IF_GetUpdateSettings(int *mode, int *interval, int *enableRoaming); |
| 132 | int Zte_DmApp_IF_SetUpdateSettings(int mode, int interval, int enableRoaming); |
| 133 | #endif |