/***************************************************************************** ** File: main_app_external.c ** ** Description: ** ** Copyright(c) 2008 Sunmedia Technologies - All Rights Reserved ** ** Author : qin.he ** ** $Id: $ *****************************************************************************/ /*header file*/ #include #include "umf_debug.h" #include "main_app.h" #include "app_event.h" #include "sysapp_table.h" #include "sysapp_if.h" #include "app_msg_filter.h" #include "app_msg_filter_tbl.h" #include "sysapp_timer.h" #include "gobj_datastruct.h" #include "al_fw.h" #include "kmf_ioctl.h" #include "ap_extern.h" #include "util_ioctl.h" #include "drv_blt_interface.h" #include "osd_lib.h" #ifdef CONFIG_ATV_SUPPORT #include "atv_guiobj_table.h" #endif #include "app_menumgr.h" #include "app_audio.h" #include "app_video.h" #include "app_global.h" #include "app_gui.h" #include "app_power_control.h" #include "app_systime.h" #include "app_data_setting.h" #include "main_guiobj_table.h" #include "app_guiobj_source.h" #include "app_guiobj_adjust.h" #include "app_guiobj_mainmenupop.h" //#include "app_guiobj_mainmenu.h" //#include "app_guiobj_fm_factory.h" #include "app_guiobj_sleeptimer.h" #include "pin_config.h" #ifdef CONFIG_SUPPORT_MEDIA_AUTO_PLAY #include // DIR need #include "MM_media_auto_play.h" #endif #ifdef SUPPORT_CEC_TV #include "umf_cec.h" #endif #include "app_usb_upgrade.h" #ifdef SUPPORT_WAKEUP_TIMER_IN_STANDBY //#include "app_guiobj_channel.h" #endif #include "app_factory.h" #include "atv_app.h" #ifdef CONFIG_MEDIA_ENABLE #include "MM_popmsg_gui.h" #endif /*----------------Net------------------*/ #ifdef CONFIG_NET_SUPPORT #include "net_daemon.h" #include "net/net_app/net_config.h" #include "app_net_instance.h" #ifdef SUPPORT_NET_TESTING #include "net/net_app/net_test.h" #endif #ifdef CONFIG_NET_ET_SUPPORT #include "cbk_event.h" #include "net_daemon.h" #include "net/et/libet.h" #endif #ifdef SAMBA_SUPPORT #include "app_network.h" #endif #ifdef CONFIG_NET_N32_SUPPORT #include "net/dlmgr/dlmgr_if.h" #include "net/net_app/net_config.h" #endif #ifdef NET_WIFI_SUPPORT #include "dvb_gui_object_wifi_list.h" #endif /*+++++++++++++++++NET++++++++++++++++++++*/ #include "platform_venc.h" #include "net/net_app/net_config.h" #include "net_daemon.h" #ifdef SUPPORT_NET_TESTING #include "net/net_app/net_test.h" #endif #include "network_app.h" #endif #include "app_clone_data.h" #include "main_app_external.h" #ifdef SUPPORT_FACTORY_AUTO_TEST //#include "Debug_msg.h" #endif #ifdef SUPPORT_SHOP_DEMO_MODE #include "app_guiobj_picture.h" #endif #ifdef SUPPORT_LED_FLASH #include "app_led_control.h" #endif #include "mid_partition_list.h" #include "app_guiobj_hdmilink.h" #include "customize.h" #if defined(CONFIG_AUTO_USB_STORE_IRSEQ) && defined(CONFIG_QSD_AUTOIR) #include "umf_automation.h" #endif #ifdef CONFIG_BLUETOOTH_SUPPORT #include "al_bluetooth.h" #endif #if defined(CONFIG_BT_RDA5856)||defined(CONFIG_BT_POL6556) #include "app_bt.h" #endif #define MAIN_APP_DEBUG #ifdef MAIN_APP_DEBUG #undef mainapp_printf #define mainapp_printf(fmt, arg...) UMFDBG(0,"[MAINAPP]:"fmt, ##arg) #else #define mainapp_printf(fmt, arg...) ((void) 0) #endif #define NUM_RESEND_MESSAGE_TYPE (DMN_EVENT_DEVICE_DETECT_MAX-DMN_EVENT_DEVICE_DETECT_MIN-1) #define NUM_RESEND_MESSAGE_OF_TYPE (10) #ifdef CONFIG_SUPPORT_MEDIA_AUTO_PLAY #define MAX_COM_BUF_SIZE 2048 #define INTERNAL_COM_DISK_NAME_LEN (15) #ifdef CONFIG_SUPPORT_PARTITIONNUM_MAX #define MAX_COM_PARTITION_NUM (20) #else #define MAX_COM_PARTITION_NUM (8) #endif #define MM_COMMON_AUTO_PLAY "AutoPlay" static char PlayComFilePath[MAX_COM_BUF_SIZE]; static UINT8 gb_NeedAutoPlay = FALSE; #endif #ifdef CONFIG_NET_SUPPORT extern Common_SysSet_NetETConfigStorage_t stNetConfigStorage; #endif #ifdef SUPPORT_WAKEUP_TIMER_IN_STANDBY extern Boolean g_fRecorderNeedEntryStandby; #endif #ifdef AC_ON_AUTO_GET_TIME extern Boolean g_fBackgroundGetTime; #endif #if defined(CONFIG_BT_RDA5856) extern Boolean g_SystemPowerOnReadyNeedReconnectBT; extern UINT8 g_BT_HasHeart; #endif #ifdef CONFIG_NET_SUPPORT extern int gMsgHandle; #ifdef CONFIG_NET_ET_SUPPORT static void _MAINAPP_EtMountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum); static void _MAINAPP_EtUnmountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum); #endif #ifdef CONFIG_NET_N32_SUPPORT static void _MAINAPP_N32MountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum); static void _MAINAPP_N32UnmountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum); #endif #ifdef CONFIG_NET_ET_SUPPORT MainAppUIEventHandlerInfo_t stUIEventHandlerInfo = { STATUS_NULL, UI_EVENT_NULL, TOTAL_SYS_APP_SIZE }; #endif #endif GUI_Object_Definition_t* MAIN_APP_GUI_Obj_List[MAINAPP_GUIOBJ_MAX] = { }; /* global variables */ static Boolean g_bPowerOffFlag = FALSE; static UINT32 gdResentMessage[NUM_RESEND_MESSAGE_TYPE][NUM_RESEND_MESSAGE_OF_TYPE] = {{0}}; static UINT32 gdResentParam[NUM_RESEND_MESSAGE_TYPE][NUM_RESEND_MESSAGE_OF_TYPE] = {{0}}; extern Boolean gUSBUpgradeBinIsSupperBin; static Boolean g_CheckUpgrade = FALSE;//for mantis 0164559 @20120204 #ifdef SUPPORT_FACTORY_AUTO_TEST typedef struct{ UINT32 dResendMessage; UINT32 dResendMessageParm; }sFACResentMessage; static sFACResentMessage gFACTESTResentMessage = {0,0}; static Boolean AcPowerOnNoRomBinFlag = FALSE; #endif #ifdef SUPPORT_USB_UPGRADE_LONG_PRESS_KEYPAD_POWER extern UINT8 IsKeypadPowerOnPressRepeat; UINT32 USB_ATTACHED = FALSE; #endif static void _MAINAPP_ResendEventInTransition(void) { UINT32 dActiveSysApp = 0; UINT8 u8Count1 = 0; UINT8 u8Count2 = 0; switch (MAINAPP_GetActiveSystemAppIndex(&dActiveSysApp)) { case MAIN_APP_IN_TRANSITION: mainapp_printf(" In Transition State, wait and retry.\n"); break; case MAIN_APP_SUCCESS: for (u8Count1 = 0; u8Count1 < NUM_RESEND_MESSAGE_TYPE; u8Count1++) { for (u8Count2 = 0; u8Count2 < NUM_RESEND_MESSAGE_OF_TYPE; u8Count2++) { if (gdResentMessage[u8Count1][u8Count2] > 0) { MSG_FILTER_DispatchMessage(gdResentMessage[u8Count1][u8Count2], gdResentParam[u8Count1][u8Count2]); } } } break; default: mainapp_printf("[%s] In Invalid State\n",__FUNCTION__); for (u8Count1 = 0; u8Count1 < NUM_RESEND_MESSAGE_TYPE; u8Count1++) { for (u8Count2 = 0; u8Count2 < NUM_RESEND_MESSAGE_OF_TYPE; u8Count2++) { gdResentMessage[u8Count1][u8Count2] = 0; gdResentParam[u8Count1][u8Count2] = 0; } } break; } } static void _MAINAPP_SetEventInTransition(UINT32 dMessage, UINT32 dParam) { UINT8 u8Count = 0; if (((dMessage-DMN_EVENT_DEVICE_DETECT_MIN) > 0) && ((dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1) < NUM_RESEND_MESSAGE_TYPE)) { for (u8Count = 0; u8Count < NUM_RESEND_MESSAGE_OF_TYPE; u8Count++) { //zhongbaoxing added @20120313. no need to record the exist messages if((gdResentMessage[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] == dMessage) &&(gdResentParam[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] == dParam)) { break; } if (gdResentMessage[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] == 0) { gdResentMessage[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] = dMessage; gdResentParam[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] = dParam; break; } } } } static void _MAINAPP_ClearEventInTransition(UINT32 dMessage, UINT32 dParam) { UINT8 u8Count = 0; if (((dMessage-DMN_EVENT_DEVICE_DETECT_MIN) > 0) && ((dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1) < NUM_RESEND_MESSAGE_TYPE)) { for (u8Count = 0; u8Count < NUM_RESEND_MESSAGE_OF_TYPE; u8Count++) { if ((gdResentMessage[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] == dMessage) &&(gdResentParam[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] == dParam)) { gdResentMessage[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] = 0; gdResentParam[dMessage-DMN_EVENT_DEVICE_DETECT_MIN-1][u8Count] = 0; break; } } } } /***************************************************************************** ** FUNCTION : _MAINAPP_GUIFeedbackEventHandler ** ** DESCRIPTION : ** main app feedback event handler ** ** PARAMETERS : ** dMessage: feadback message ** dParam: feadback message's paramter ** ** RETURN VALUES: ** None *****************************************************************************/ void _MAINAPP_GUIFeedbackEventHandler(UINT32 dMessage, UINT32 dParam) { switch(dMessage) { default: mainapp_printf(" Unknown GUI feedback message received.\n"); break; } return; } /***************************************************************************** ** FUNCTION : _MAINAPP_UIEventHandler ** ** DESCRIPTION : ** main app UI event handler ** ** PARAMETERS : ** dMessage: UI message ** dParam: UI message's paramter ** ** RETURN VALUES: ** None *****************************************************************************/ int _MAINAPP_UIEventHandler(UINT32 dMessage, UINT32 dParam) { UINT32 dIndex = 0; APP_Source_Type_t eSourceType; eSourceType = APP_SOURCE_MAX; if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { if((dMessage == UI_EVENT_POWER)||(dMessage == UI_EVENT_KEYPAD_POWER)) { if (SYSAPP_GOBJ_GUIObjectExist(dIndex, APP_GUIOBJ_SLEEP_INFO))//close sleeptimer menu { APP_GUIOBJ_SleepTimer_Reset(); SYSAPP_GOBJ_DestroyGUIObject(dIndex, APP_GUIOBJ_SLEEP_INFO); return MAIN_APP_SUCCESS; } #ifdef SUPPORT_POWERAGAIN_CONFIRM_POWEROFF if ((!SYSAPP_GOBJ_GUIObjectExist(dIndex, APP_GUIOBJ_MAINMENUPOP) || APP_GUIOBJ_MainPopMsg_GetPopType() != MAINPOPMSG_SHOW_CONFIRM_POWER) && (dParam == AL_POWER_STATE_CONFIRM))//no auto power off or reset power { SYSAPP_IF_SendGlobalEventWithIndex(dIndex, APP_GLOBAL_EVENT_CONFIRM_POWER|PASS_TO_SYSAPP, 0); return MAIN_APP_SUCCESS; } #endif } APP_GUIOBJ_Source_GetCurrSource(&eSourceType); } if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { #ifdef CONFIG_SUPPORT_OTA_UPGRADE if (SYS_APP_DVB == dIndex) { if (SYSAPP_GOBJ_GUIObjectExist(dIndex, DVB_GUIOBJ_OTA_UPGRADE_PROGRESS) && (AL_POWER_STATE_MAX != dParam)) { return MAIN_APP_SUCCESS; } } #endif #ifdef CONFIG_SUPPORT_USB_UPGRADE if (SYSAPP_GOBJ_GUIObjectExist(dIndex, APP_GUIOBJ_SOFTWARE_UPGRADE)) { return MAIN_APP_SUCCESS; } #endif } switch (dMessage) { case UI_EVENT_POWER: #if defined(CONFIG_BT_RDA5856)||defined(CONFIG_BT_POL6556) APP_BT_DisConnect_CurrentBT(); #endif #ifdef SUPPORT_WAKEUP_TIMER_IN_STANDBY if (APP_WAKEUP_GetBootFlag() == TRUE) { #ifdef AC_ON_AUTO_GET_TIME if (g_fBackgroundGetTime == TRUE) { g_fBackgroundGetTime = FALSE; } #endif g_fRecorderNeedEntryStandby = FALSE; /*< light backlight */ APP_WAKEUP_RealPowerUp(); return MAIN_APP_SUCCESS; } else #endif { #ifdef CHECK_USB_FOR_SLEEP_AND_STANDBY /* * if the POWER event is from handset, check usb status for schedruler rec */ if (APP_IsUIMessageType()) { USB_PvrSt_t USB_ST = USB_MSG_SUCCESS; UINT32 dActiveSysApp = 0; USB_ST = APP_CheckUSBStatus(); if (MAINAPP_GetActiveSystemAppIndex(&dActiveSysApp) == MAIN_APP_SUCCESS) { UINT32 u32PopMsgName = POPMSG_PROMPT_NO_PROG; #ifdef CONFIG_MEDIA_ENABLE UINT32 u32MMPopName = FILE_POP_PLAYBACK_NONE; if (SYS_APP_FILE_PLAYER == dActiveSysApp) { u32MMPopName = MM_PopMsg_GetCurrentPopup(); } else #endif if ((SYS_APP_ATV== dActiveSysApp) || (SYS_APP_DVB== dActiveSysApp)) { APP_GUIOBJ_PopMsg_GetMsgDialogType(&u32PopMsgName); } if ((u32PopMsgName != POPMSG_CONFIRM_INSERT_USB) && (u32PopMsgName != POPMSG_CONFIRM_INVALID_USB) #ifdef CONFIG_MEDIA_ENABLE && (u32MMPopName != FILE_POP_PVR_INSERT_USB_CONFIRM) && (u32MMPopName != FILE_POP_PVR_INVALID_USB_CONFIRM) #endif ) { switch(USB_ST) { case USB_MSG_SUCCESS: break; case USB_MSG_FAIL_NO_STORAGE: SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, APP_GLOBAL_EVENT_PVR_INSERT_USB_CONFIRM|PASS_TO_SYSAPP, 0); return MAIN_APP_SUCCESS; default: SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, APP_GLOBAL_EVENT_PVR_INVALID_USB_CONFIRM|PASS_TO_SYSAPP, 0); return MAIN_APP_SUCCESS; } } } } #endif AL_Setting_Read(APP_Data_UserSetting_Handle(), SYS_SET_ID_FACTUSER, 0, sizeof(APP_SETTING_FactoryUser_t), &(g_stFactoryUserData)); if (g_stFactoryUserData.n_FactSet_BurningMode == 1) { return MAIN_APP_SUCCESS; } mainapp_printf(" UI_EVENT_POWER received.\n"); #ifdef CONFIG_AUTO_USB_STORE_IRSEQ extern int AUTO_IF_Stop(void); AUTO_IF_Stop(); #endif #ifdef SUPPORT_WAKEUP_TIMER_IN_STANDBY #ifdef CONFIG_SUPPORT_USB_UPGRADE extern bool g_bUpgradeForceStandby; #endif if((APP_WAKEUP_CheckTimer() == FALSE) #ifdef CONFIG_SUPPORT_USB_UPGRADE || (g_bUpgradeForceStandby == TRUE) #endif ) #endif { //zhongbaoxing added to mute the video for mantis 0166639 @20120224 #ifdef CONFIG_SUPPORT_SUBTITLE if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { if (dIndex == SYS_APP_DVB) { DVBApp_DataApplicationSwitch(OSD2CTRLMDL_DISABLE|OSD2CTRLMDL_SUB); } } #endif #ifdef CONFIG_SUPPORT_TTX if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { #ifdef CONFIG_ATV_SUPPORT if(SYS_APP_ATV == dIndex) { if (SYSAPP_GOBJ_GUIObjectExist(dIndex, ATV_GUIOBJ_TTX)) { SYSAPP_GOBJ_DestroyGUIObject(dIndex, ATV_GUIOBJ_TTX); } } #endif } #endif #ifdef CONFIG_CC_SUPPORT if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { if(dIndex == SYS_APP_ATV) { if(SYSAPP_GOBJ_GUIObjectExist(SYS_APP_ATV, ATV_GUIOBJ_CC)) { SYSAPP_GOBJ_DestroyGUIObject(SYS_APP_ATV, ATV_GUIOBJ_CC); } } } #endif #ifdef SUPPORT_CEC_TV AL_Setting_Read(APP_Data_UserSetting_Handle(), SYS_SET_ID_FEATURE, 0, sizeof(APP_SETTING_Feature_t), &(g_stFeatureData)); if (( APP_SWITCH_ON == g_stFeatureData.Enable_HDMILink) &&(APP_SWITCH_ON == g_stFeatureData.HDMI_AutoStandby)) { if (CECTV_GetCECEnable()==CECTV_ENABLE) { CECTV_SendCmd(CECTV_SINGLE_ACT_CMD_STANDBY, 0); /*mainapp_printf("[%s]:Waiting for CECTV_SINGLE_ACT_CMD_STANDBY Send Complete !!!!!\n\n", __FUNCTION__); UINT8 i=0; while(CECTV_GetCECTaskStatus()!=CEC_TASK_Standby)//Waiting for CEC Message Send complete { i++; GL_TaskSleep(10); if (i > 50) { break; } }*/ } } #endif #ifdef CONFIG_SUPPORT_USB_MCAST if (MAIN_APP_SUCCESS == MAINAPP_GetActiveSystemAppIndex(&dIndex)) { #ifdef CONFIG_SUPPORT_NETAPP if(dIndex == SYS_APP_NETWORK) { if(SYSAPP_GOBJ_GUIObjectExist(SYS_APP_NETWORK, NET_GUIOBJ_USB_MCAST_PAGE)) { SYSAPP_GOBJ_DestroyGUIObject(SYS_APP_NETWORK, NET_GUIOBJ_USB_MCAST_PAGE); } } #endif } #endif #ifdef CONFIG_BLUETOOTH_SUPPORT Al_Bluetooth_Disable(); GL_TaskSleep(50); Al_Bluetooth_Destory(); #endif Cmd_gpio_WriteOnLevel(GPIO_AUDIO_CTL); Cmd_gpio_WriteOffLevel(GPIO_12V_EN); AL_Power_SetPowerState(dParam); /* g_stUserInfoData.PowerStatus = APP_SWITCH_OFF; // power off AL_Setting_Write(APP_Data_UserSetting_Handle(), SYS_SET_ID_USERINFO, ITEM_OFFSET(APP_SETTING_UserInfo_t, PowerStatus), sizeof(g_stUserInfoData.PowerStatus), &(g_stUserInfoData.PowerStatus)); AL_Setting_Store(APP_Data_UserSetting_Handle(), SYS_SET_ID_USERINFO, ITEM_OFFSET(APP_SETTING_UserInfo_t, PowerStatus), sizeof(g_stUserInfoData.PowerStatus));*/ #ifdef AC_ON_AUTO_GET_TIME if (g_fBackgroundGetTime == TRUE) { /* keep the latest source if get time over */ g_fBackgroundGetTime = FALSE; APP_Source_Type_t SourceIndex; SourceIndex = APP_GUIOBJ_Source_GetStandbySource(); g_stUserInfoData.SourceIndex = SourceIndex; AL_Setting_Write(APP_Data_UserSetting_Handle(), SYS_SET_ID_USERINFO, ITEM_OFFSET(APP_SETTING_UserInfo_t, SourceIndex), sizeof(g_stUserInfoData.SourceIndex),&(g_stUserInfoData.SourceIndex)); AL_Setting_Store(APP_Data_UserSetting_Handle(), SYS_SET_ID_USERINFO, ITEM_OFFSET(APP_SETTING_UserInfo_t, SourceIndex), sizeof(g_stUserInfoData.SourceIndex)); } #endif #ifdef CONFIG_SUPPORT_MIRACAST WriteP2pConfigToFlash(); #endif MAINAPP_FinalizeFlow(dParam); } } break; case UI_EVENT_MUTE: if (MAINAPP_GetActiveSystemAppIndex(&dIndex) == MAIN_APP_SUCCESS) { SYSAPP_IF_SendGlobalEventWithIndex(dIndex,(dMessage | PASS_TO_SYSAPP), dParam); } break; case UI_EVENT_SOURCE: mainapp_printf("[%s]: UI_EVENT_SOURCE!!!!!\n\n", __FUNCTION__); break; #ifdef SUPPORT_USB_UPGRADE_LONG_PRESS_KEYPAD_POWER case UI_EVENT_KEYPAD_POWER_UPGRADE: if (MAINAPP_GetActiveSystemAppIndex(&dIndex) == MAIN_APP_SUCCESS) { dMessage = APP_GLOBAL_EVENT_USB_UPGRADE | PASS_TO_SYSAPP; SYSAPP_IF_SendGlobalEventWithIndex(dIndex, dMessage, 0); // 1:EraseAll,0:not EraseAll g_CheckUpgrade = TRUE; } break; #endif case APP_GLOBAL_EVENT_OSD_CAPTURE: { mainapp_printf("\n\n%s APP_GLOBAL_EVENT_OSD_CAPTURE\n", __FUNCTION__); //extern int app_capture_osd_handler(void); //app_capture_osd_handler(); //mainapp_printf("capture OK! \n"); char szMountName[20]; char szTempName[20] = {0}; char fileNameStringtemp[50] = {0}; char fileNameString[200] = {0}; struct stat stStat; memset(fileNameStringtemp, 0, 50); memset(fileNameString, 0, 200); memset(szMountName, 0, sizeof(szMountName)); MID_PartitionList_GetMountName(0, szMountName); if(strcmp(szMountName, szTempName)) { sprintf(fileNameStringtemp,"%s/%s", szMountName,"SPOSD"); if (stat(fileNameStringtemp, &stStat) < 0) { if (mkdir(fileNameStringtemp, O_WRONLY | O_CREAT) < 0) { mainapp_printf("%s mkdir failed\n", __FUNCTION__); break; } } static int fn = 0; fn++; sprintf(fileNameString,"%s/%s%d_%.3d%.2d.bmp", fileNameStringtemp,"OSD_",fn,rand()%1000,rand()%100); mainapp_printf("\nfileNameString:%s\n",fileNameString); OSD_ChangeIntoBitmap(fileNameString); mainapp_printf("\n\n%s capture ok!\n", __FUNCTION__); } break; } case FW_DB_LOAD_DEFAULT: #ifdef CONFIG_DVB_SYSTEM_DVBS_SUPPORT if (AL_DBTYPE_DVB_S == APP_DVB_Playback_GetCurrentNetType()) { /* wait for DVB-S becomes acticve */ while(AL_FW_CheckActiveDBModule(AL_DBTYPE_DVB_S) != al_true); DVBApp_LoadCustomerDB(AL_DBTYPE_DVB_S); AL_DB_Sync(AL_DBTYPE_DVB_S, al_true); } #endif break; default: mainapp_printf(" Un-handled UI Eventid: 0x%x.\n", dMessage); break; } return MAIN_APP_SUCCESS; } #ifdef CONFIG_SUPPORT_MEDIA_AUTO_PLAY /******************************************************************************/ /** * @brief Check Folder Path Exist * @param char* const Folder_Path : Folder Path * @return TRUE : Folder is exist\n * FALSE : Folder is not exist * ******************************************************************************/ static BOOL FileSystem_Lib_Com_IsFolderExist(char* const Folder_Path) { if (Folder_Path == NULL) { mainapp_printf("Folder_Path = NULL\n"); return FALSE; } DIR* dir; dir = opendir(Folder_Path); if (dir == NULL) { mainapp_printf("Folder Path = %s is not exist!\n", Folder_Path); return FALSE; } if (closedir(dir) != 0) { mainapp_printf("call closedir fail\n"); return FALSE; } dir = NULL; return TRUE; } static UINT16 FileSystem_Lib_Com_GetTotalSupportedPartitionNumber(void) { int MountedCount = MID_PartitionList_GetMountedCount(); if (MountedCount > MAX_COM_PARTITION_NUM) { mainapp_printf("Partition Num = %d is more than %d\n", MountedCount, MAX_COM_PARTITION_NUM); MountedCount = MAX_COM_PARTITION_NUM; } return MountedCount; } static BOOLEAN MM_AutoPlay_Com_SetFlag(void) { UINT16 TotalPartition = FileSystem_Lib_Com_GetTotalSupportedPartitionNumber(); UINT16 i = 0; char Name[INTERNAL_COM_DISK_NAME_LEN + 1]; for (i = 0; i < TotalPartition; i++) { MID_PartitionList_GetMountName(i, Name); memset(PlayComFilePath, 0, MAX_COM_BUF_SIZE); snprintf(PlayComFilePath, MAX_COM_BUF_SIZE, "%s/%s", Name, MM_COMMON_AUTO_PLAY); mainapp_printf("[%s:%d] FilePath = %s \n", __FUNCTION__, __LINE__, PlayComFilePath); if (FileSystem_Lib_Com_IsFolderExist(PlayComFilePath)) { mainapp_printf("[%s:%d]i = [%d] folder exist \n", __FUNCTION__, __LINE__, i); return TRUE; } } //mainapp_printf("[%s:%d]: bAutoPlay = %d \n", __FUNCTION__, __LINE__, bAutoPlay); return FALSE; } #endif /***************************************************************************** ** FUNCTION : _MAINAPP_DaemonEventHandler ** ** DESCRIPTION : ** main app daemon event handler ** ** PARAMETERS : ** dMessage: daemon message ** dParam: daemon message's paramter ** ** RETURN VALUES: ** None *****************************************************************************/ void _MAINAPP_DaemonEventHandler(UINT32 dMessage, UINT32 dParam) { #ifdef CONFIG_NET_SUPPORT #ifdef NET_APP_SUPPORT UINT8 i; UINT8 bFlag = 0; char *pcMountName = NULL; int iPtnHandle = 0; #endif #endif UINT32 dActiveSysApp = 0; int sdPtIdx = -1; INT32 iRet = AL_FAILURE; #if defined(CONFIG_SUPPORT_USB_AUTO_UPGRADE) app_data_keyupgrade_status_e updateCI = APP_DATA_KEYUPGRADE_NOT_UPGRADE; app_data_keyupgrade_status_e updateHDCP = APP_DATA_KEYUPGRADE_NOT_UPGRADE; #ifdef CONFIG_SUPPORT_STORE_HDCP2X_TO_FLASH app_data_keyupgrade_status_e updateHDCP2X = APP_DATA_KEYUPGRADE_NOT_UPGRADE; #endif UINT32 dKeyparam = 0; UINT32 dKeyUpgradeEvent = 0; #endif #if defined(CONFIG_NET_ET_SUPPORT) || defined (CONFIG_NET_N32_SUPPORT) MainAppUIEventHandlerInfo_t *pstEventInfo = &stUIEventHandlerInfo; #endif switch (dMessage) { case DMN_EVENT_BD_VIDEO_DISC_INSERTED: case DMN_EVENT_DVD_VIDEO_DISC_INSERTED: case DMN_EVENT_VCD_DISC_INSERTED: case DMN_EVENT_TEMPTEST_START_USB_DVD: break; case DMN_EVENT_USB_HDD_ATTACHED: case DMN_EVENT_USB_LOADER_ATTACHED: case DMN_EVENT_CARD_DEV_ATTACHED: case DMN_EVENT_IDE_HDD_ATTACHED: case DMN_EVENT_IDE_LOADER_ATTACHED: case DMN_EVENT_NAND_ATTACHED: { #if defined(CONFIG_AUTO_USB_STORE_IRSEQ) && defined(CONFIG_QSD_AUTOIR) AUTO_IF_Start(SEQUENTIAL_TEST, 0) #endif #ifdef SUPPORT_USB_UPGRADE_LONG_PRESS_KEYPAD_POWER if(dMessage == DMN_EVENT_USB_HDD_ATTACHED) { USB_ATTACHED = TRUE; } #endif #ifdef CONFIG_STORE_MSG_TO_USB { UINT8 isEnablePrintToUSB = 1; ioctl(kmfdev, KMF_IOC_PRINTOFILEENABLE, &isEnablePrintToUSB); } #endif iRet = APP_Data_USB_Upgrade_ChecFileAndBuildTime(); //mainapp_printf("[L%d] DEV_ATTACHED(%d) received.\n", __LINE__,dMessage); switch (MAINAPP_GetActiveSystemAppIndex(&dActiveSysApp)) { case MAIN_APP_IN_TRANSITION: //mainapp_printf("[L%d] In Transition State, wait and retry.\n",__LINE__); _MAINAPP_SetEventInTransition(dMessage, dParam); return; case MAIN_APP_SUCCESS: //mainapp_printf("[L%d] MAIN_APP_SUCCESS!!!\n",__LINE__); break; default: mainapp_printf("[%s %d] In Invalid State\n",__FUNCTION__,__LINE__); return; } _MAINAPP_ClearEventInTransition(dMessage, dParam); #if defined(CONFIG_SUPPORT_USB_AUTO_UPGRADE) #ifdef CONFIG_SUPPORT_STORE_HDCP2X_TO_FLASH updateHDCP = APP_Data_HDCPKey_Upgrade_AutoStart(iRet); updateHDCP2X = APP_Data_HDCP2XKey_Upgrade_AutoStart(iRet); updateHDCP = (updateHDCP || updateHDCP2X); #else updateHDCP = APP_Data_HDCPKey_Upgrade_AutoStart(iRet); #endif dKeyparam = (updateHDCP<<4) | updateCI; dKeyUpgradeEvent = APP_GLOBAL_EVENT_CIHDCPKEY_RESULT | PASS_TO_SYSAPP; SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, dKeyUpgradeEvent, dKeyparam); #endif #ifdef CONFIG_NET_SUPPORT MID_PartitionList_Mount(sdPtIdx, MntModule_Network); #ifdef CONFIG_NET_ET_SUPPORT _MAINAPP_EtMountHandle(pstEventInfo, dParam); #endif #ifdef CONFIG_NET_N32_SUPPORT _MAINAPP_N32MountHandle(pstEventInfo, dParam); #endif #endif #ifdef CONFIG_NET_SUPPORT #ifdef NET_APP_SUPPORT pcMountName = (char *)GL_MemAlloc(_SPAL_PARTITION_NAME_MAX_LENGTH); memset(pcMountName, 0, _SPAL_PARTITION_NAME_MAX_LENGTH2); iPtnHandle = MID_PartitionList_FindItem(dParam); if (iPtnHandle == -1) { mainapp_printf("get ptn handle\n"); } if (MID_PartitionList_GetMountName(iPtnHandle, pcMountName) == NULL) { mainapp_printf("Get Mount Name\n"); } if (strcmp(pcMountName, stNetConfigStorage.stParName) == 0) { Net_Cfg_SetDlPath(stNetConfigStorage.stParName); } if (NULL != pcMountName) { GL_MemFree(pcMountName); } if (stNetConfigStorage.u8IsSetNetConfigStorage == 0) { stNetConfigStorage.u8IsSetNetConfigStorage = 1; stNetConfigStorage.u8NetConfigStorage = 0; MID_PartitionList_GetMountName((int)stNetConfigStorage.u8NetConfigStorage, stNetConfigStorage.stParName); Net_Cfg_SetDlPath(stNetConfigStorage.stParName); } #endif #endif SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, dMessage, (UINT32)sdPtIdx); #if (defined(SUPPORT_FACTORY_AUTO_TEST)||defined(SUPPORT_FACTORY_AUTO_TEST_MODE2)) if (APP_Factory_GetAutoTestOnOff() == TRUE) { Cmd_SetPanelBacklightPower(1); } #endif #ifdef SUPPORT_FACTORY_AUTO_TEST if ((APP_Factory_GetAutoTestOnOff() == TRUE)&&(iRet == AL_FAILURE)) { extern void Enable_Debug_Message(UINT32 DBGStatus); Enable_Debug_Message(1<stNetDriveCtrlInfo.eState = NET_DRIVE_STATE_SHUT_DOWN; if (MAINAPP_GetActiveSystemAppIndex(&dActiveSysApp) == MAIN_APP_SUCCESS) { SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, dMessage, dParam); } break; case DMN_EVENT_NET_LINKER_ATTACHED: mainapp_printf("DMN_EVENT_NET_LINKER_ATTACHED received.\n"); #if defined( SAMBA_SUPPORT ) && defined( SUPPORT_ETHERNET ) DVB_Network_MountSmbFs(); #endif pstEventInfo->stNetDriveCtrlInfo.eState = NET_DRIVE_STATE_BOOTUP; if (MAINAPP_GetActiveSystemAppIndex(&dActiveSysApp) == MAIN_APP_SUCCESS) { SYSAPP_IF_SendGlobalEventWithIndex(dActiveSysApp, dMessage, dParam); } break; #endif case DMN_EVENT_MAINAPP_STARTS: mainapp_printf(" DMN_EVENT_MAINAPP_STARTS received.\n"); #ifdef CONFIG_NET_SUPPORT MAINAPP_NetAPInit(); #endif break; default: mainapp_printf(" Un-handled Daemon Eventid: 0x%x.\n", dMessage); break; } return; } /***************************************************************************** ** FUNCTION : MAINAPP_OnTimerUpdate ** ** DESCRIPTION : ** main app 100ms message handler ** ** PARAMETERS : ** None ** ** RETURN VALUES: ** None *****************************************************************************/ int MAINAPP_OnTimerUpdate(void) { UINT32 dIndex = 0; /*mark for S2tek */ #ifdef SUPPORT_FACTORY_AUTO_TEST if((APP_Factory_GetAutoTestOnOff() == TRUE) && (APP_Factory_GetUpgradeandAutoTestFlag() == FALSE)) { static UINT8 CheckCount = 0; //100ms * 50 CheckCount++; CheckCount %= 255; if(CheckCount >= 50 && gFACTESTResentMessage.dResendMessage != 0) { APP_Factory_SetAutoTestOnOff(FALSE); APP_Factory_SetUpgradeandAutoTestFlag(TRUE); MSG_FILTER_DispatchMessage(gFACTESTResentMessage.dResendMessage, gFACTESTResentMessage.dResendMessageParm); g_CheckUpgrade = TRUE; gFACTESTResentMessage.dResendMessage = 0; gFACTESTResentMessage.dResendMessageParm= 0; } } #endif _MAINAPP_ResendEventInTransition(); AL_Time_Timeout(); if (APP_SleepTimer_GetDetectFlag()) { if(!(APP_MenuMgr_Exist_Factory_Menu())) { if (APP_GUIOBJ_SleepTimer_Timeout()) { if(MAIN_APP_SUCCESS != MAINAPP_GetActiveSystemAppIndex(&dIndex)) { printf("GetActiveSystemApp faile\n"); } if(SYSAPP_GOBJ_GUIObjectExist(dIndex, APP_GUIOBJ_SLEEP_INFO)) { APP_GUIOBJ_SleepTimer_SetSleepPopConflict(TRUE); } SYSAPP_IF_SendGlobalEventWithIndex(dIndex, (APP_GLOBAL_EVENT_SLEEP_TIMER_INFO | PASS_TO_SYSAPP), APP_POWERDOWN_SLEEP); APP_SleepTimer_SetDetectFlag(FALSE); } } } if (APP_AutoPowerOff_Timeout() || APP_2Hours_PowerOff_Timeout()) { if(MAIN_APP_SUCCESS != MAINAPP_GetActiveSystemAppIndex(&dIndex)) { printf("GetActiveSystemApp faile\n"); } if (SYSAPP_GOBJ_GUIObjectExist(dIndex, APP_GUIOBJ_SLEEP_INFO) && (APP_GUIOBJ_SleepTimer_GetStandbyPopConflict() == FALSE)) { APP_GUIOBJ_SleepTimer_SetStandbyPopConflict(TRUE); } SYSAPP_IF_SendGlobalEventWithIndex(dIndex, (APP_GLOBAL_EVENT_SLEEP_TIMER_INFO | PASS_TO_SYSAPP), APP_POWERDOWN_AUTOPOWEROFF); #if 0 while(!SYSAPP_GOBJ_GUIObjectExist(SYS_APP_DVB, APP_GUIOBJ_SLEEP_INFO)) { MAINAPP_SendGlobalEvent(UI_EVENT_POWER, AL_POWER_STATE_OFF); } #endif } #ifdef SUPPORT_SHOP_DEMO_MODE if (APP_ShopDemo_Timeout()) { APP_GUIOBJ_Picture_SetPictureMode(TV_IDS_String_Picture_dynamic); APP_GUIOBJ_Picture_SetColourTemp(TV_IDS_String_Standard); APP_Video_OSD_PQSet(APP_VIDEO_OSD_ITEM_BACKLIGHT, 100); } #endif #if defined(CONFIG_SUPPORT_SET_CLOCK_ONOFFTIME)|| defined (TEAC_ONOFF_TIMER_SUPPORT) APP_OffTimer_Check(); #ifdef TEAC_ONOFF_TIMER_SUPPORT APP_OnTimer_Check_WhenPanelOff(); #endif #endif #if defined(CONFIG_BT_RDA5856) if(APP_BT_GetHeartTimer() >= 50) { if(APP_BT_GetHeartTimer()!= 0xff) { APP_BT_SetHeartTimer(0xff); MSG_FILTER_DispatchMessage(DMN_EVENT_BLUETOOTH_WAITCONNECT,0); } } else { APP_BT_SetHeartTimer(APP_BT_GetHeartTimer()+1); } if(g_SystemPowerOnReadyNeedReconnectBT == TRUE) { APP_Source_Type_t getCurrSourType = APP_SOURCE_MAX; APP_GUIOBJ_Source_GetCurrSource(&getCurrSourType); if(getCurrSourType != APP_SOURCE_BLUETOOTH) { AL_Setting_Read(APP_Data_UserSetting_Handle(), SYS_SET_ID_SETUP,0, sizeof(APP_SETTING_Setup_t), &(g_stSetupData)); UINT8 NULLADDR[6] = ""; if(APP_BT_GetBTIsReady() == TRUE) { g_SystemPowerOnReadyNeedReconnectBT = FALSE; if((g_stSetupData.BTMode != BT_MODE_SEND) ||(memcmp((const void *)g_stSetupData.BTAddrs,(const void *)NULLADDR,sizeof(t_bdaddr)) == 0)) { ;//do nothing } else { APP_BT_Auto_ReconnectBTDevice(); } } } else { g_SystemPowerOnReadyNeedReconnectBT = FALSE; } } #endif #ifdef CONFIG_SUPPORT_MEDIA_AUTO_PLAY if (gb_NeedAutoPlay && APP_GUIOBJ_Source_GetSourceTransState() == FALSE && MM_AutoPlay_Com_SetFlag()) { APP_GUIOBJ_Source_SetAppSource(APP_SOURCE_MEDIA); gb_NeedAutoPlay = FALSE; } #endif #ifdef CONFIG_SKIP_AC_POWERKEY UINT8 key0State = GPIO_LEVEL_LOW; static UINT8 checkHighTimes = 0; Cmd_gpio_Read(GPIO_KEY0_PIN,&key0State); if(GPIO_LEVEL_HIGH == key0State) { checkHighTimes++; if(checkHighTimes >= 10) { MAINAPP_SendGlobalEvent(UI_EVENT_POWER, AL_POWER_STATE_OFF); } } #endif return SP_SUCCESS; } /***************************************************************************** ** FUNCTION : MAINAPP_OnEvent ** ** DESCRIPTION : ** main app external event handler ** ** PARAMETERS : ** dMessage : message ** dParam : the parameter for dMessage ** ** RETURN VALUES: ** None *****************************************************************************/ int MAINAPP_OnEvent(UINT32 dMessage, UINT32 dParam) { if((dMessage < UI_EVENT_NULL) || ((dMessage > APP_GLOBAL_EVENT_MIN) && (dMessage < APP_GLOBAL_EVENT_MAX))) { //mainapp_printf("==================_MAINAPP_UIEventHandler()=================\n"); _MAINAPP_UIEventHandler(dMessage, dParam); } else if ((dMessage > DMN_EVENT_MIN && dMessage < DMN_EVENT_MAX) || (dMessage > DMN_EVENT_DEVICE_DETECT_MIN && dMessage < DMN_EVENT_DEVICE_DETECT_MAX)) { //mainapp_printf("==================_MAINAPP_DaemonEventHandler()=================\n"); _MAINAPP_DaemonEventHandler(dMessage, dParam); } else if (dMessage > GUI_RESPOND_MIN && dMessage < GUI_RESPOND_MAX) { //mainapp_printf("==================_MAINAPP_GUIFeedbackEventHandler()=================\n"); _MAINAPP_GUIFeedbackEventHandler(dMessage, dParam); } return SP_SUCCESS; } /***************************************************************************** ** FUNCTION : MAINAPP_GetPowerOffState ** ** DESCRIPTION : ** Get power off state ** ** PARAMETERS : ** None ** ** RETURN VALUES: ** g_bPowerOffFlag: power off state *****************************************************************************/ Boolean MAINAPP_GetPowerOffState(void) { return g_bPowerOffFlag; } /***************************************************************************** ** FUNCTION : MAINAPP_SetPowerOffState ** ** DESCRIPTION : ** Set power off state ** ** PARAMETERS : ** PowerOffFlag - power off state ** ** RETURN VALUES: ** None *****************************************************************************/ void MAINAPP_SetPowerOffState(Boolean PowerOffFlag) { g_bPowerOffFlag = PowerOffFlag; } #ifdef CONFIG_NET_ET_SUPPORT static void MAINAPP_NetAPInit(void) { NetDaemonCfg_t stNetDaemon; stNetDaemon.pfEventCallBack = NetDaemon_callback; #ifdef NET_WIFI_SUPPORT Net_WifiFlashiInit(); #endif if (NET_IF_Initialize(&stNetDaemon) != NET_DAEMON_IF_SUCCESSFUL) { mainapp_printf("ERROR: init net daemon\n"); } if (APP_NET_Initialize() != APP_NET_IF_SUCCESSFUL) { mainapp_printf("ERROR: app init net daemon\n"); } #ifdef SUPPORT_NET_TESTING if (NetTest_Init(1) != 0) { mainapp_printf("ERROR: Init Net Testing Thread\n"); } #endif } MainAppUIEventHandlerInfo_t *MAINAPP_GetNetHandlerInfo(void) { return &stUIEventHandlerInfo; } static void _MAINAPP_EtMountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum) { int iPtnHandle = 0; char *pszMountPonit = NULL; if (!pstEventInfo) { mainapp_printf("%s\n", __FUNCTION__); return; } pszMountPonit = GL_MemAlloc(ET_PATH_NAME_MAX_LENTH); if (!pszMountPonit) { mainapp_printf("alloc et new path name\n"); return; } memset(pszMountPonit, 0, ET_PATH_NAME_MAX_LENTH); do { iPtnHandle = MID_PartitionList_FindItem(dDevNum); if (iPtnHandle == -1) { mainapp_printf("invalidate ptn handle\n"); break; } if (MID_PartitionList_GetMountName(iPtnHandle, pszMountPonit) == NULL) { mainapp_printf("get ptn mount point error!\n"); break; } pstEventInfo->stSysDriveCtrlInfo.iSysCurPtnHnd = iPtnHandle; } while (0); GL_MemFree(pszMountPonit); } static void _MAINAPP_EtUnmountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum) { int iPtnHandle = 0; char *pszMountPonit = NULL; if (!pstEventInfo) { mainapp_printf("%s\n", __FUNCTION__); return; } pszMountPonit = GL_MemAlloc(ET_PATH_NAME_MAX_LENTH); if (!pszMountPonit) { mainapp_printf("alloc et new path name\n"); return; } memset(pszMountPonit, 0, ET_PATH_NAME_MAX_LENTH); do { iPtnHandle = MID_PartitionList_FindItem(dDevNum); if (iPtnHandle == -1) { mainapp_printf("invalidate ptn handle\n"); break; } if (MID_PartitionList_GetMountName(iPtnHandle, pszMountPonit) == NULL) { mainapp_printf("get ptn mount point error!\n"); break; } #if 0 sdReturnValue = NET_IF_InstOps(NET_DAEMON_INST_ET, NET_DAEMON_INST_OPS_UNMOUNT_CHECK, (UINT32)pszMountPonit); if (sdReturnValue < NET_DAEMON_IF_SUCCESSFUL) { mainapp_printf("boot up check et download\n"); break; } #endif pstEventInfo->stSysDriveCtrlInfo.iSysCurPtnHnd = iPtnHandle; } while (0); GL_MemFree(pszMountPonit); } #endif #ifdef CONFIG_NET_N32_SUPPORT static void _MAINAPP_N32MountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum) { INT32 sdReturnValue = MAIN_APP_SUCCESS; int iPtnHandle = 0; char *pszMountPonit = NULL; if (!pstEventInfo) { mainapp_printf("%s\n", __FUNCTION__); return; } pszMountPonit = GL_MemAlloc(DLMGR_IF_FILEPATH_MAX_LEN); if (!pszMountPonit) { mainapp_printf("alloc et new path name\n"); return; } memset(pszMountPonit, 0, DLMGR_IF_FILEPATH_MAX_LEN); do { iPtnHandle = MID_PartitionList_FindItem(dDevNum); if (iPtnHandle == -1) { mainapp_printf("get ptn handle\n"); break; } if (MID_PartitionList_GetMountName(iPtnHandle, pszMountPonit) == NULL) { mainapp_printf("get ptn mount point error!\n"); break; } //add by ztli 2010/08/04 for mantis bug 96324 start { if (iPtnHandle == 0) { Net_Cfg_SetDlPath(pszMountPonit); } //add by ztli end } //sdReturnValue = NET_IF_InstOps(NET_DAEMON_INST_N32,NET_DAEMON_N32_INST_OPS_MOUNT_CHECK,(UINT32)pszMountPonit); //if(sdReturnValue < NET_DAEMON_IF_SUCCESSFUL) sdReturnValue = APP_NET_InstCtrl(APP_NET_INST_N32, APP_NET_INST_OPS_MOUNT, (UINT32)pszMountPonit); if (sdReturnValue < APP_NET_IF_SUCCESSFUL) { mainapp_printf("boot up check et download\n"); break; } } while (0); GL_MemFree(pszMountPonit); } static void _MAINAPP_N32UnmountHandle(MainAppUIEventHandlerInfo_t *pstEventInfo, UINT32 dDevNum) { INT32 sdReturnValue = MAIN_APP_SUCCESS; int iPtnHandle = 0; char *pszMountPonit = NULL; if (!pstEventInfo) { mainapp_printf("%s\n", __FUNCTION__); return; } pszMountPonit = GL_MemAlloc(DLMGR_IF_FILEPATH_MAX_LEN); if (!pszMountPonit) { mainapp_printf("alloc et new path name\n"); return; } memset(pszMountPonit, 0, DLMGR_IF_FILEPATH_MAX_LEN); do { iPtnHandle = MID_PartitionList_FindItem(dDevNum); if (iPtnHandle == -1) { mainapp_printf("invalidate ptn handle\n"); break; } if (MID_PartitionList_GetMountName(iPtnHandle, pszMountPonit) == NULL) { mainapp_printf("get ptn mount point error!\n"); break; } //sdReturnValue = NET_IF_InstOps(NET_DAEMON_INST_N32,NET_DAEMON_N32_INST_OPS_UNMOUNT_CHECK,(UINT32)pszMountPonit); //if(sdReturnValue < NET_DAEMON_IF_SUCCESSFUL) sdReturnValue = APP_NET_InstCtrl(APP_NET_INST_N32, APP_NET_INST_OPS_UNMOUNT, (UINT32)pszMountPonit); if (sdReturnValue < APP_NET_IF_SUCCESSFUL) { mainapp_printf("boot up check et download\n"); break; } } while (0); GL_MemFree(pszMountPonit); } #endif