⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 brewififo.c

📁 Brew上IFIFO基本功能使用的例子
💻 C
📖 第 1 页 / 共 2 页
字号:
        // An SMS message has arrived for this app. Message is in the dwParam above as (char *)
        // sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
        case EVT_APP_MESSAGE:
		    // Add your code here...

      		return(TRUE);

        // A key was pressed. Look at the wParam above to see which key was pressed. The key
        // codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
        case EVT_KEY:
		    // Add your code here...
            
            switch(wParam)
            {
            case AVK_1:
                
                IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);

                IDISPLAY_DrawText(pMe->a.m_pIDisplay,
                            AEE_FONT_BOLD,
                            szPost,
                            -1,
                            0,
                            0,
                            NULL,
                            IDF_ALIGN_CENTER | IDF_ALIGN_MIDDLE);
            
                IDISPLAY_Update (pMe->a.m_pIDisplay);               
                
                Mms_StartPostMessage(pMe);
          
                break;
 
            case AVK_2:
                
                {
ILogger *pILog;
int     iResult;
uint32  args[10];


                }

           

                               


            default:
                break;

            }
            
      		return(TRUE);
        
        case EVT_DISPLAY:
            {           
                AECHAR      *pAEChar;
                                
                pAEChar = (AECHAR*)MALLOC(sizeof(AECHAR) * wParam);
                
                STRTOWSTR((char*)dwParam, pAEChar, wParam * 2);

                IDISPLAY_ClearScreen(pMe->a.m_pIDisplay);

                IDISPLAY_DrawText(pMe->a.m_pIDisplay,
                                AEE_FONT_BOLD,
                                pAEChar,
                                -1,
                                0,
                                0,
                                NULL,
                                IDF_ALIGN_LEFT | IDF_ALIGN_TOP);
            
                IDISPLAY_Update (pMe->a.m_pIDisplay);            

            }
            return(TRUE);

        // If nothing fits up to this point then we'll just break out
        default:
            break;
   }

   return FALSE;
}

static boolean FIFORead_HandleEvent(BrewIFIFO* pMe, AEEEvent eCode, uint16 wParam, uint32 dwParam)
{  

    switch (eCode) 
	{
        // App is told it is starting up
        case EVT_APP_START:                        
		    // Add your code here...

            return(TRUE);


        // App is told it is exiting
        case EVT_APP_STOP:
            // Add your code here...

      		return(TRUE);


        // App is being suspended 
        case EVT_APP_SUSPEND:
		    // Add your code here...

      		return(TRUE);


        // App is being resumed
        case EVT_APP_RESUME:
		    // Add your code here...

      		return(TRUE);


        // An SMS message has arrived for this app. Message is in the dwParam above as (char *)
        // sender simply uses this format "//BREW:ClassId:Message", example //BREW:0x00000001:Hello World
        case EVT_APP_MESSAGE:
		    // Add your code here...

      		return(TRUE);

        // A key was pressed. Look at the wParam above to see which key was pressed. The key
        // codes are in AEEVCodes.h. Example "AVK_1" means that the "1" key was pressed.
        case EVT_KEY:
		    // Add your code here...

            switch(wParam)
            {
            case AVK_1:            
                
                ISHELL_CloseApplet(pMe->a.m_pIShell,TRUE);
      		    break;
            case AVK_2:

                ISHELL_CloseApplet(pMe->a.m_pIShell,FALSE);
                break;
            }    
            return(TRUE);

        case EVT_READ_FIFO:

 //           Mms_StartGetMessage(pMe);

            return(TRUE);


        case EVT_APP_START_BACKGROUND:

            Mms_StartGetMessage(pMe);
            
            return(TRUE);

        // If nothing fits up to this point then we'll just break out
        default:
            break;
   }

   return FALSE;
}


/****************************************************************************************/
/************************************Init App Data **************************************/
/****************************************************************************************/
// this function is called when your application is starting up
boolean FIFORead_InitAppData(BrewIFIFO* pMe)
{
    // Get the device information for this handset.
    // Reference all the data by looking at the pMe->DeviceInfo structure
    // Check the API reference guide for all the handy device info you can get
    pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
    ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);

    // Insert your code here for initializing or allocating resources...



    // if there have been no failures up to this point then return success
    return TRUE;
}


boolean FIFOWrite_InitAppData(BrewIFIFO* pMe)
{
    // Get the device information for this handset.
    // Reference all the data by looking at the pMe->DeviceInfo structure
    // Check the API reference guide for all the handy device info you can get
    pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
    ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);

    // Insert your code here for initializing or allocating resources...


    // if there have been no failures up to this point then return success
    return TRUE;
}


/****************************************************************************************/
/************************************Free App Data **************************************/
/****************************************************************************************/
// this function is called when your application is exiting
void FIFOWrite_FreeAppData(BrewIFIFO* pMe)
{
    // insert your code here for freeing any resources you have allocated...

    // example to use for releasing each interface:
    // if ( pMe->pIMenuCtl != NULL )         // check for NULL first
    // {
    //    IMENUCTL_Release(pMe->pIMenuCtl)   // release the interface
    //    pMe->pIMenuCtl = NULL;             // set to NULL so no problems trying to free later
    // }
    //

}


void FIFORead_FreeAppData(BrewIFIFO* pMe)
{
    // insert your code here for freeing any resources you have allocated...

    // example to use for releasing each interface:
    // if ( pMe->pIMenuCtl != NULL )         // check for NULL first
    // {
    //    IMENUCTL_Release(pMe->pIMenuCtl)   // release the interface
    //    pMe->pIMenuCtl = NULL;             // set to NULL so no problems trying to free later
    // }
    //
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -