MTK MTK_MMI_Training_经典_第1页
MTK MTK_MMI_Training_经典_第2页
MTK MTK_MMI_Training_经典_第3页
MTK MTK_MMI_Training_经典_第4页
MTK MTK_MMI_Training_经典_第5页
已阅读5页,还剩81页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

MMITraining 23 10 2006 Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBPCSimulator SoftwareArchitecture Overview UEM UserEquipmentModulePHB PhoneBookSMU SecurityManagementUnitCSM CallServiceManagement RAC RegistrationandAccessControlSMSAL SMSApplicationLayerTCM TrafficCommunicationManagementENG Engineermode RMI RemoteMMIL4 TheadaptationlayerL4A Layer4AdaptationL4C Layer4ControllerATCI ATCommandInterpreter Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBPCSimulator MMIArchitecture MMITask BriefDescription ElementsofFrameworkEventHandlers RegistersandexecutesapplicationcallbacksforvariouseventsClassificationofeventsProtocoleventsKeyeventsHistory HelpsapplicationmaintainscreenflowandstoreintermediatedataOSL Provideswrapperstoalloperatingsystemdependentcallstobemadebytheapplication e g OslMalloc FileSystem ProvidesdatastorageandretrievalofdatafromFileSystemNVRAM ProvideswrappersfordatastorageandretrievalofdatafromNVRAM MMITask DetailedDescription 1 8 FrameworkLayerProvidesEventHandlersAPIforapplicationtomanageeventhandlersatruntime KeyEventhandlersAPI TypicallyusedbyapplicationsandcategoryfunctionsSetkeyhandlerforparticularkeySetKeyhandlerforgroupofkeysExecutecurrentkeyhandlerforkeypresseventClearkeyhandlersforparticularkeyClearkeyhandlersforallkeysSpecialhandlingforPowerandEndKey MMITask DetailedDescription 2 8 ProtocolEventHandlersAPI TypicallyusedbyapplicationsSetprotocolandinterrupteventhandler ExecuteCurrentprotocoleventhandler Clearhandlerforspecificprotocolevent Clearallprotocoleventhandler MMITask DetailedDescription 3 8 Entry ExitScreenHandlersEntrythenewscreen registertheentryandexithandlerExitthecurrentscreenAddHistoryExitScreen callscurrExitFuncPtr ReleaseGUIscreenresourceRegisterNewscreeninformationscrID ExitFuncPtr EntryFuncPtr MMITask DetailedDescription 4 8 Highlight HintHandlersLookupthetable callsthefunctionHiliteHandlerAPISet Execute ClearExecuteCurrHiliteHandlerSetHiliteHandlerGetCurrHiliteIDClearHiliteHandlerClearAllHiliteHandlerHintHandlerAPISet Clear ConstructConstructHintsListSetHintHandlerClearHintHandler MMITask DetailedDescription 5 8 HistoryDatabasecontainingsnapshotsofscreenImplementedasaLIFOstackStructureofhistorynodeScreenID associatedwithascreentobesavedEntryFunctionPointer toredrawthescreenInputBuffer tosaverunningtextdataforthisscreenGUIBuffer tosaveUIrelatedinformationforthisscreen MMITask DetailedDescription 6 8 HistoryAPIAddNodetoHistoryDelete N nodesfromhistoryGoback N nodesinhistoryRetrievehistoryforascreenRetrieveinputbufferforscreenRetrieveUIbufferforscreenDumpHistoryfordebuggingInitializehistoryFirstscreensavedafterbootupisneverremoved ExampleofApplicationFlow IdleMainMenuAppMainMenu ScreenId IdleEntry Idle ScreenId IdleEntry Idle ScreenId mainMenuEntry mainMenu ScreenId IdleEntry Idle currExitFuncPtr Exit Idle Exit mainMenu Exit App Exit mainMenu ApplicationScreen Entry mainMenu Exit Idle Entry App Exit mainMenu GoBackHistory Entry mainMenu HistoryStack MMITask DetailedDescription 7 8 OSLLayerProvidesabstractionoversystemcallstomakeMMIportableFollowingkernelobjectsarewrappedQueuesTimersQueueAPICreateQueueoslMsgqidOslIntCreateMsgQ PS8queue name U32max msg size U32max msgs WriteToQueueOSLSTATUSOslIntWriteMsgQ oslMsgqidmsgqid void msgPtr U32msgSize OSLWAITMODEwait mode ReadFromQueueOSLSTATUSOslIntReadMsgQ oslMsgqidmsgqid void msgPtr U32 msgSize OSLWAITMODEwait mode MMITask DetailedDescription 8 8 TimerAPIStartTimer U16timerid U32delay FuncPtrfuncPtr StopTimer U16timerid MMITask UILayer 1 2 ProvidesUIdisplayfunctionstoapplicationsComponentsofUILayerCategoryScreensIntelligentwrapperstodrawthescreensofapplicationsAcceptresourcessuchasStringIDsandImageIDsfromapplications Keeptheapplicationindependentofthelayoutandthelook and feelofscreensProvideinterfacesofhistory MMITask UILayer 2 2 DrawManagerPurposeKeepthedecisionofpositionandsizeindependentofGUIkernelcodeControlsetDefineallcomponentsdisplayedonscreenCoordinatesetDefinepositionandsizeofallcomponentsEachcontrolsethasonedefaultcoordinatesetUIElementsThislayerprovidesabilitytodisplayandmanipulatevariousUIelementssuchasbuttons scrollbars menusetc ThesearethebuildingblocksoftheUserInterfaceGraphicsLibrary GDI ProvidesthesupportforgraphicsprimitivesContainsfunctionstodisplayFontsandImages CategoryScreenFunctions 1 3 CategoryScreenFunctionsThecategorylayerconsistsofasetoffunctionsforapplicationstoshowitsUserInterfaceEachCategoryscreencontainsthefollowingfunctionsShowCategoryxxxScreenExitCategoryxxxScreenGetCategoryxxxScreenHistoryGetCategoryxxxScreenHistorySize CategoryScreenFunctions 2 3 ShowCategoryxxxScreenEntryfunctionforaCategoryscreenCalledbyapplicationsArgumentsvaryfromcategoryscreentocategoryscreen Example voidShowCategory1Screen STRING IDTitle IMAGE IDTitleIcon STRING IDLSKLabel IMAGE IDLSKIcon STRING IDRSKLabel IMAGE IDRSKIcon INTNumberOfItems STRING ID ListOfItems BYTE HistoryBuffer CategoryScreenFunctions 3 3 ExitCategoryxxxScreenExitfunctionforaCategoryscreenCalledbytheapplicationwhentheCategoryscreenisnolongerortemporarilynotneededDoesnotclearallthescreenRestoresomeglobalvariablesandresetUIcomponentsattributesGetCategoryxxxScreenHistoryGetsthehistorydataoftheCategoryscreenUsefulinhandlingAsynchronouseventsthatupdatethescreenGetCategoryxxxScreenHistorySizeUsedtogetthesizeinbytesofthespacerequiredtostorethehistorydataoftheCategoryscreen DrawManager 1 3 ControlSetDefineallcomponentsdisplayedonscreen ForeachcategoryscreenEx constU8category157 5 DM BASE LAYER START DM BASE CONTROL SET1 DM NEW LAYER START DM INLINE FIXED LIST1 DM CATEGORY CONTROL AREA1 DrawManager 2 3 CoordinateSetDefinepositionandsizeofallcomponentsFordifferentscreensEx consts16coordinate set157 0 0 176 220 DM NO FLAGS 0 42 220 158 DM NO FLAGS 0 0 176 158 DM NO FLAGS 0 0 176 220 DM NO FLAGS DrawManager 3 3 Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBPCSimulator NVRAMIntroduction Thedefaultvaluesarestoredinthesystemfiles socalledNVRAM Non VolatileRepositoryAccessManager files ThosefilescanbeidentifiedbytheirDataItemIDs TheNVRAMmanagerprovidesNVRAMread writeinterfacewithprotocolstack TheseinterfacesareusedbydifferentMMIapplicationstowritedatatoorretrievedatafromNVRAM NVRAMAccess ProvideswrappersfordatastorageandretrievalofdatafromNVRAM ValueReadValue nId pBuffer nDataType pError WriteValue nId pBuffer nDataType pError RecordReadRecord nFileId nRecordId pBuffer nBufferSize pError WriteRecord nFileId nRecordId pBuffer nBufferSize pError NVRAM Normaldataitems Toconfiguredataitems eitheraddordeleteadataitem orjustmodifyadefaultvalue followthe6stepsbelow 1 DefineLIDinto nvram LID cust enum innvram user defs h2 Definetwoconstants SIZEandTOTAL innvram user defs h3 Defineversionofthenewdataitemincustom nvram editor data item h4 Definethenewlogicaldataitemincustom editor data item h thisdefinitionwillbeneededbyMETA5 Definedefaultvalueofthatnewlogicaldataiteminnvram user config c6 Defineattributesofthatnewlogicaldataiteminto logical data item table cust innvram user config c NVRAM ExampleforNormaldataitems Step1DefineLID SinceuserapplicationaccessdataitemsmanagedbyNVRAMdataservicebyspecifyingLogicalDataItemID theLIDmustbedefined Innvram user defs h defineaLIDat nvram LID cust enum NVRAM ExampleforNormaldataitems Step2SIZEandTOTAL Thisistodefinesizeandtotalconstantsfornewlydefineddataitem Eachlogicalitemmustdefinethesetwoconstantswhichimplicitlydefinestypeofthedataitem MY NEW DATAisdefinedasadataitemwith2recordsandsizeofeachrecordis10byte NVRAM ExampleforNormaldataitems Step3Defineversionofthenewdataitemfollowingtheconvention NVRAM newdataitemname LID VERNO instringincustom nvram editor data item hex defineNVRAM MY NEW DATA LID VERNO 000 NVRAM ExampleforNormaldataitems Step4Definethenewlogicaldataitemincustom editor data item h thisdefinitionwillbeneededbyMETAex LID BITVER LID NVRAM MY NEW DATA LID nvram my new data struct NVRAM MY NEW DATA TOTAL NVRAM ExampleforNormaldataitems Step5Eachdataitemcouldbedefinedadefaultvalue Adataitemwithoutanyphysicaldatapreviouslywrittentoitwillstorethedefaultvaluedefinedhere Innvram user config c definedefaultvalueforthenewdataitem Thesizeofadefaultvaluemustbeequaltothesizedefineinstep2 IfthisvalueisassignedasNULL thendefaultvalueforthedataitemisallbypewithvalueof0 xff IfthisvalueisassignedasNVRAM EF ZERO DEFAULT thendefaultvalueforthedataitemisallbyteswithvalueof0 x00 NVRAM ExampleforNormaldataitems Step6Defineattributesofthatnewlogicaldataiteminto logical data item table cust innvram user config cex NVRAM MY NEW DATA LID LID NVRAM MY NEW DATA SIZE Size NVRAM MY NEW DATA TOTAL Numberofrecords NVRAM EF ZERO DEFAULT Defaultvalue NVRAM ATTR NONE Attributes NVRAM CATEGORY USER Category NVRAM DRV FDM Device CT0r VER NVRAM MY NEW DATA LID TodoList 0 NVRAM AVERAGE LID kal uint8 NVRAM INVALID VALUE Reserved recordIDiscalculatedbyNVRAM Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBPCSimulator MMIResource 1 9 MMIResource 2 9 StringStep1 addstringtoref list txt mcu plutommi Customer CustResource PLUTO MMI Step2 addstringIDtoENUMassociatedwithappStep3 usingmacroADD APPLICATION STRING2Step4 S8 my string GetString MY STR ID UsingAPP BASEtoguaranteetheuniquenessofstringIDImageStep1 putimagesinthefolderassignedtoappStep2 addimageIDtoENUMassociatedwithappStep3 usingmacroADD APPLICATION IMAGE2Step4 usingimageIDdirectlyasparameterUsingAPP BASEtoguaranteetheuniquenessofimageID MMIResource 3 9 MenuParentmenuUniquemenuitemIDHilitefunctionandLSKhandlerAssociatedwithscreenAudio mcu tools AudioResGen AudioResGen exe SkinLayout MCTTOOL AudioplayerCalculatorFMRadioTheme MCTTOOL Fonts MCTTOOL MMIResource 4 9 ADD APPLICATION STRING2 STR CAL MONTH M Chinesemonth StringID Value DescriptionADD APPLICATION IMAGE2 IMG CAL ON CUST IMG BASE PATH EmptyImage bmp IconforOnButton ImageID Path Description MMIResource 5 9 ADD APPLICATION MENUITEM MENU CAL TYPE MenuID ORGANIZER CALENDER MENU ParentID 1 Childnumber MENU ID CHILD 1 ChildID SHOW Hideorshow NONMOVEABLE Moveattribute DISP LIST Displayattribute CAL STRING LUNAR StringID 0 ICONID MMIResource 6 9 MMIResource 7 9 ResourceTargerObject OnWin32 mmiresource dll mcu plutommi mmi Debug OnHardware mmiresource lib mcu build G968 gprs MT6218Bo lib ResourceGenerator Method1 Callplutommi Customer ResGenerator batMethod2 makecustom A01gsmupdatemmiresource MMIResource 8 9 UseResource String S8 string GetString MY STR ID Image See plutommi mmi GUI GUI INC gui hVoid pixtel UI show image s32x s32y UI image typei Void pixtel UI show transparent image s32x s32y UI image typei UI transparent color typet Void pixtel UI measure image UI image typei s32 width s32 height s32 pixtel UI image n frames UI image typei Byte pixtel UI show transparent animated image frame s32x s32y UI image typei UI transparent color typet s16frame number Byte pixtel UI show animated image frame s32x s32y UI image typei s16frame number See plutommi mtkapp GDI GDIInc gdi image hGDI RESULTgdi image draw S32offset x S32offset y U8 image ptr GDI RESULTgdi image draw id S32offset x S32offset y U16image id GDI RESULTgdi image draw file S32offset x S32offset y S8 image name MMIResource 9 9 Menu AllmenudatastoryinCUSTOM MENUnCustMenus typedefstructCustom MenuItem U16nMenuItemId UniqueIdforeachMenuItem U16nParentId ItemIdoftheparentif0 zero thennoparent U16nNumofMenuItem NumberofChildrenithas U16nHideFlag Thisisaflagtomask hide notsurecurrently U16nMovable Thisisaflagformovinglike0 NotMovableAnywhere U16nDispAttribute Thisisadisplayattributeflaglike1 list 2 Circular 3 Tab etc U16nStrId UniqueStringIdoftheMenuItem U16nImageId UniqueImageoftheMenuItem U16 nOrderMenuItemId ItemIdofthechildreninSequence CUSTOM MENU Audio See plutommi mmi Audio AudioInc AudioInc hvoidAudioPlayReq U16soundId U8style voidAudioStopReq U16soundId MMIResourceCustomization 1 2 String modifyref list txtbyhandImageReplacetheoriginalpicturewithsamedimensionVerifyusingMCTReferto176X220GPRS pdfFontFont And Input Method Spec for Different Languages pdfUsingMCT MMIResourceCustomization 2 2 MenuCustomizationbyhandRingMcu tools AudioResGen AudioResGen exeUserManualForAudioResourceGeneratortool doc Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBPCSimulator Writeanapplication Writeanapplication DeclarationofIdsScreens MenuItem Strings Images Audio MediaPopulateResourceInitializationRoutineRoutinestosetupdataforuseinapplicationsPopulateStrings ImagesandMenuresourcesRegisterProtocolEventandHighlightHandlersHighlightHandlersRoutinesthatexecuteuserdefinedcodeonhighlightingthemenuitem EntryandExitFunctionsFunctionstomanageflowofscreenforanapplicationForwardflowofscreenismanagedbytheapplicationBackwardflowofscreenismanagedbyhistory Example ApplicationScenario Screen1 Hellomessage Screen2 Inputthesignature Example SelectCategoryScreens Category66Screen Category69Screen Example DefineResources String 4Image 3Audio None 1 2 3 4 1 2 3 Example DefineResources Plutommi MMI inc PixtelDataType h defineDEMO GILBERT APPDEMO APP BASE 500 Plutommi MMI App App Inc App Def h typedefenum 2categoryscreens SCR ID DEMOGILBERT 1 DEMO GILBERT APP 1 SCR ID DEMOGILBERT ENUM typedefenum 4stringresource STR ID DEMOGILBERT APP TITLE DEMO GILBERT APP 1 STR ID DEMOGILBERT ENUM typedefenum 3imageresource IMG ID DEMOGILBERT APP ICON DEMO GILBERT APP 1 IMG ID DEMOGILBERT ENUM Example PopulateResources Plutommi Customer CustResource Prj MMI Res MMI Res App c voidPopulateDemoGilbertRes void ADD APPLICATION STRING2 STR ID string comment ADD APPLICATION IMAGE2 IMG ID file comment ADD APPLICATION MENUITEM ADD APPLICATION MENUITEM2 Example ScenarioFlow SetHighlightHandler Plutommi MMI App App Src App Src c Plutommi MMI ParentApp ParentApp Src ParentApp Src c voidDemoGilbertInit void Sethighlighthandler SetHiliteHandler ORGANIZER DEMOGILBERT MENU HighlightDemoGilbertMenu voidOrgInit void DemoGilbertInit Example ScenarioFlow HighlightHandler voidHighlightDemoGilbertMenu void ChangeLeftSoftkey STR GLOBAL OK IMG GLOBAL OK SetRightSoftkeyFunction GoBackHistory KEY EVENT UP SetLeftSoftkeyFunction EntryDemoGilbertMenu KEY EVENT UP SetKeyHandler EntryDemoGilbertMenu KEY RIGHT ARROW KEY EVENT DOWN Example ScenarioFlow ScreenEntryFunction voidEntryDemoGilbertMenu void EntryNewScreen SCR ID DEMOGILBERT 1 NULL EntryDemoGilbertMenu NULL programlogic constructdisplayedstringandicon ShowCategory66Screen STR ID DEMOGILBERT APP TITLE IMG ID DEMOGILBERT APP ICON STR GLOBAL OPTIONS IMG GLOBAL OPTIONS STR GLOBAL BACK IMG GLOBAL BACK g DemoGilbert strWelcome IMG ID DEMOGILBERT WELCOME NULL programlogic Setsoftkeyfunctionsorkeyhandlers Outline SoftwareArchitectureMMIArchitectureNVRAMInterfaceMMIResourceWriteanapplicationMemoryManagementATCommandSMS PHBFrameworkPCSimulator MemoryManagement dynamicmemory 2kindsofdynamicmemorySystemmemoryForgeneralpurposedynamicmemoryallocation Withoutgarbagecollection limitedforpermanentlyresideapplication Sizeconfigurableat mcu custom system customerboardversion custom config c defineGLOBAL MEM SIZE 300 1024 DebugmemorySpecialfordebugging eg DEBUG KAL DEBUG BUFetc Sizeconfigurableat mcu custom system customerboardversion custom config c defineGLOBAL DEBUG MEM SIZE 64 1024 MemoryManagement bufferpool InheritsfromNUCLEUSPLUSpartitionmemorypool FixedmemorysizeCoverageControlbufferStorageoftransmissiondata localparameterandpeerbufferofanilm struct Size 8 16 32 64 128 256 512 1024and2048Bytes TSTbufferForCatchertraceandprimitivedump Size 32 64 128 256 512 1024and2048Bytes MemoryManagement Controlbuffer 1 3 ControlbufferintroductionFixedsizebuffer offersnotmorethan2KBallocationUsedforapplications run timememoryusage controlplaneandtemporarydatastructurestorageThenumberandsizeofpoolscanbeconfiguredviafile ctrl buff pool h MemoryManagement Controlbuffer 2 3 MemoryManagement Controlbuffer 3 3 ControlbufferAPIsget ctrl bufferPrototype void get ctrl buffer size Headerfile app alloc buff hInput sizeissizeofbuffertobeallocated Output Bufferpointerisreturnedinthemannerofvoid anyunsuccessfuloperationwillbere directedtosystemerror Description Thisiscommoninterfaceforallocatingabufferfromthesmallestfitcontrolbuffer free ctrl bufferPrototype voidfree ctrl buffer void ptr Headerfile app alloc buff hInput ptrisbufferpointertobereleased Description Thisiscommoninterfaceforreturningabufferpointertothesystem MemoryManagement ADM 1 3 ADMintroductionAllocatingbufferlargerthan2KBGoingthroughitsownerrorhandlingifallocationfailureADMAPIskal adm createPrototype KAL ADM IDkal adm create void mem addr kal uint32size kal uint32 subpool size kal boolislogging Headerfile kal release hInput mem addrisstartingaddressofthememorypool sizeistotalsizeofthememorypool subpool sizeisanarray whichdescribethetotalnumberofsub poolsanditssize isloggingisloggingflag guardpatterncheckingandoperationloggingwillbeenabledifitisKAL TRUE Output IDthecreatedADM Description ThisserviceaimsforcreatinganADMfromthegivenmemorypool ADMcontrolblock headerandfooterfootprintsmustbetakenintoaccountwhilecalculatingthepoolsize Totaloverheadisthesummationofthefollowing Fixedsizeoverhead 12 16 16x numberofsub poolentries Floatingoverhead 8Bheaderforeachallocation extra16Boverheadforfooterifloggingisenabled Defaultvaluewillbeadoptedifsubpool sizeisNULL MemoryManagement ADM 2 3 kal adm allocPrototype void kal adm alloc adm id size Headerfile kal release hInput adm idisdestinationADM fromwhereamemorypiecewillbeallocated andsizeistherequiredmemorysize Output Pointeroftheallocatedmemorypieceifoperationsuccessfullydone otherwise NULL Description ThisserviceaimsatallocatingamemorypiecefromthededicatedADM Beverycarefulthat ifADMloggingisenabled extramemoryspacewillbeconsumed Itisexcludedfromthesizespecifiedininputparameter kal adm deletePrototype kal statuskal adm delete KAL ADM IDadm id Headerfile kal release

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论