Hello all,
Some Acronyms:
- BREW - Binary Runtime Environment For Wireless.
- AEE - Application Execution Environment.
- MIF - Module Information File.
- BRI - Binary Resource Intermediate.
- BAR - BREW Applet Resources.
- BAM - BREW Application Manager.
- BCI - Binary Compressed Image.
- DLL - Dynamic Link Libraries.
- BID - BREW ClassID.
- AEEAppGen.h : Contains declerations that AEEClsCreateInstance() needs in order to instantiate our module and applet.
- AEEShell.h : Contains support for the IShell services that the application will need throught out its life cycle.
- AEEFile.h : To provide file support.
BREW - Binary Runtime Environment For Wireless.Qualcomm's BREW is hardware platform, originally intended as internal library for developing software on their own custom handsets.
Components that are available in BREW SDK:
- BREW Application Execution Environment : Provides the foundation for BREW applications.
- Set of tools : MIF editor, Resource Editor, Emulator, and Device Configurator.
- BREW header files.
- BREW Utilities : PureVoice Converter,2Bit Tool,NMEA Logger.
- Add-ins to microsoft Visual Studio : Application Wizard, Automated ARM compiling, BREW Integrated Help.
- Some example apps.
- Online help.
- Resource Editor.
- MIF editor.
- BCI Authoring Tool.
- AppLoader.
- AppLogger.
- AppSigner.
It simulates a selected hand held device.
BREW application wizard:
It is included in 1.1 on and this does not exists in 1.0.This application wizard sets most of the applicable project options and produces the minimal skeliton code for a BREW application, assuming you are intended to develop in C.
Brew Application Wizard is an add on to Microsoft Visual Studio which creates following file:
- Project File(appname.dsp).
- Workspace File(appname.dsw).
- Application source file(appname.c).
- AEEAppGen.c and AEEModGen.c that are included with the BREW SDK.
MIF(Module Information File) that is created with MIF editor.
It contains information about the contents of the module:
- Supported classes.
- Supported applications.
- Application privileges.
- Application details.
- Author of the application
Note : Without MIF, BREW will act like your application does not exists.
About resource editor:
The resource editor is made up of two integrated parts : The Resource Editor, Resource Compiler.Serves as a repository for the application's strings, images and dialog resources.The resource editor stores all of the entered resources in BREW Resource Intermediate(.bri) file.BRI is resource editors native format.
The Resource editor compiles the resource contained in the .bri into a binary BREW Applet Resource(.bar) file.The application will programatically load resources at runtime.
Usage : Resources files are useful for storing language-specific strings, dialogs, and bitmaps.If you need to localize your application for use in a target device in a different language, you simply need to translate the resources in the resource file.It is not necessary to recompile the MOD or DLL file.
Development Environment:
Any development environment which can generate window's compliant dynamic link libraries is suitable for developing BREW applications which will execute on the simulator.
In BREW, an application is a class that can only have one instance(singleton). BREW loads and creats a module only once - regardless how many times it required, because loading a module is expensive process.
Loading a module requires
- Updates to system tables about "what classes are available".
- Brings executable from disk and allocates ancillary support structures.
BREW Applications are entirely event driven.
The basic elements of BREW application are :-
About BREW Module:The basic elements of BREW application are :-
- BREW classes.
- BREW shell.
- Module.
- Applet.
- Event handler.
- Class IDs.
- Resources.
- Module Information Files(MIF).
BREW API:
Represents a group of interface classes with their own set of functions to use in your applications.BREW interface are initialized and memory is allocated only when the interface is needed.Each inteface has a unique ClassID, and the name of each interface in the BREW API begins with the letter I.
Application Execution Environment (AEE):
AEE foundation of BREW,which is responsible to load and execute BREW applications.
BREW Shell (IShell):
The BREW shell(IShell) is an interface,whcih is loaded when your application first runs.IShell permits access to a wide variety of lower-level services provided by the device.
A BREW Module is a container for all of the applications functionality.
A BREW Module is a binary file containing the code for applications or extensions.
A BREW Module - as applications and extentions - are the fundamental units of code loading / contains implementation of multiple classes. It is a unique instance of IModule interface, to create a module one have to implement IModule interface.
This is accompanied by a module information file.This provides info regarding the classes your module contain.
But normally we dont do this, because Qualcomm provides a helper file AEEModGen.c. Which does this for us.
The module is loaded by the BREW shell.Fundamentally this module exports single entry point so that the BREW shell can call into your application's CreateInstance function.
CreateInstance - creates an event handler, allocates application memory and creates an instance of the IDisplay interface etc.
Event Handler:
Since BREW application model is event-driven programming model,this must contain an event handling function.After application is loaded , the BREW layer passes all input to this function as events.In BREW, substantial delays in processing events may result in the application being shutdown to safeguard the device.
BREW Class IDs:
Class IDs are a unique 32-bit ID identidying BREW applications, BREW extensions, privilege levels, or BREW interfaces.This ClassID is stored in a BREW ClassID(BID) file.
Terms "Application" and "Applet" are interchangeable.
An "Applet" is a discrete unit of functionality that the module loads and the AEE executes.
About AEEApplet:
AEEApplet is a typedef for a struct.This structure contains key information about the applet.
A module may consists more than one applet, but only one applet can be active at a time(because BREW is single - threaded ). For example single module can have two applets in it with different class ids.- m_pIShell : IShell pointer that provides access to the applet with shell services.
- m_pIModule : IModule pointer that keeps track of the module that "owns" the applet.
- m_pIDisplay : IDisplay pointerthat gives the applet the ability to write to the screen.
- pAppHandleEvent : A pointer to the applet's event handling function.
- pFreeData : A pointer to a function that frees all of the applets dynamically allocated data
BREW Application entry points:
When the user selects the application icon in the BREW Application Manager, the AEE kicks off the entire process by calling AEEMod_Load() and AEEMod_CreateInstance().
When the user selects the application icon in the BREW Application Manager, the AEE kicks off the entire process by calling AEEMod_Load() and AEEMod_CreateInstance().
NOTE:
- In the emulator, AEEMod_Load is exported from the modules DLL.
- In some production environments internal to QUALCOMM, the entry point is module_main.
- In all other cases, for OTA configuration, the entry point is AEEMod_Load, and its declared the enttry point during the link process.
AEEModGen.c contains reference source code for modules.
AEEModGen.c also implements four methods of IModule interface.
- CreateInstance : BREWinvokes this method when it needs an instance of a class provided by the module.From here we will call AEEClsCreateInstance method.
- FreeResources : This method frees additional resources consumed by the module prior to its destruction.
- AddRef : This method increments modules ref count.
- Release : This method decrements ref count and when it reaches to 0 it frees the module.
About AEEModGen.c file provided by Qualcomm:
In our code after the class ID check is done then AEEApplet_New() method will be called, whcih is defined in AEEAppGen.c. Its main function is to allocate memory for, and populate, the AEEApplet instance and then add it to the module by calling AEEMod_ListAdd().
Creating sub class of IModule:
typedef struct _SSingletonModule
{
//Declaring the virtual table for this class,whcih implements IModule.
DECLARE_VTABL(IModule)
//Ref count
uint32 nRefs;
//Pointr to the system shell.
IShell *pIShell;
//Required for static extentions and are unused for OTA applications.
PFNMODCREATEINST pfnModCrInst;
PFNFREEMODDATA pfnModFreeData;
//Our singleton pointer.
SSingletonModule *pInstance;
}SSingletonModule;
Diff between static application and dynamic application:
Static applications:
1. Built into the OEM software build.
2. Can not be deleted but can be upgraded.
Dynamic applications:
1. Downloaded OTA or preloaded at the factory.
2. Have dynamically loaded MOD file.
3. Can be upgraded, deleted, recalled.

Its simply superb.One more feather into ur cap.
ReplyDelete