Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Brew MP Development concepts

This section explains Brew MP development concepts.

Brew MP APIs

The Brew MP APIs are included with the Brew MP SDK and represent a group of interface classes with their own set of functions to use in your applications. Brew MP interfaces are initialized and memory is allocated only when the interface is needed. Each interface has a unique ClassID and the name of each interface begins with the letter I. The C/C++ API Reference lists the available interfaces and their functions for the specific Brew MP versions in alphabetical order.

To prevent the introduction of static and global data, do not link standard C libraries to your Brew MP application. Standard C library routines such as strcat(), malloc(), and sprintf() cannot be used within Brew MP. Helper functions are provided for the most commonly used C functions.

Brew MP classes

This section provides a brief overview of the Brew MP classes. A more detailed discussion of Brew MP classes is provided in the Programming Model Technology Guide on the Brew MP website.

C/C++ programs in Brew MP implement three types of Brew MP classes- applet class, in-process class and service class-- as shown in the following table.

Brew MP class types Supporting module formats Applicable Brew MP module types Supporting IDE Wizards
Applet class MOD or MOD1 Application Application (applet class)
In-Process class MOD or MOD1 Application or extension Extension (in-process class)
Service Class MOD1 Application or extension n/a

There are two module formats supported by Brew MP that contain one or more Brew MP classes; MOD and MOD1. MOD can only contain applet and in-process classes. MOD1 can contain all three types of classes. For more information on MOD and MOD1, see the MOD vs. MOD1 Technology Guide on the Brew MP website.

Brew MP software packages

A Brew MP application is a module that contains at least one applet class for loading and execution directly by Brew MP. A Brew MP extension is a module the contains only non-applet classes, and can only be loaded and executed by another Brew MP application. Each module must have a MIF. The MIF contains the module privileges and ClassIDs.

Brew MP IDE Wizards

Wizards are provided by the Brew MP Visual Studio and Eclipse plugins to assist developers with auto-generating application framework for Brew MP classes in specified module formats. When generating the framework using the Wizards, you have the option to generate either an application or an extension, in MOD/DLL format or MOD1/DLL1 format. This primer walks through generating an application in MOD/DLL format. The steps to generate code are the same for all options.

Event handler

The Brew MP application model is based on an event-driven programming model.  All Brew MP applications must contain an event handling function. After an application is loaded, the Brew MP layer passes all input to this function as events. An event may be a key press, a dialog change, or a control change.

Your application is expected to quickly determine how to handle events. All processing must be completed before the next event can be received. With Brew MP, substantial delays in processing events may result in the application being shut down to safeguard the device.

ClassIDs

ClassIDs are unique 32-bit IDs identifying Brew MP applications, Brew MP extensions, privilege levels, or Brew MP interfaces. The ClassID associated with an interface is used to request the interface from the system shell. The ClassID is stored in a Brew MP ClassID (BID) file, which is required for compilation. The BID file is created by the Resource Manager when generating a ClassID locally. Uniquely identifying ClassIDs becomes important when your application is ready to be run on device, or made public or commercial.  A unique ClassID for an application or extension can be generated from the Brew MP ClassID Generator via the Brew MP website.

Resources

Many modules include resources, strings, icons and dialog boxes. Rather than hard-coding them into the module, resources can be created in a separate header file. For more information refer to the Tools Reference, included in the documents installed with the Brew MP SDK.

Component Information Files (CIFs) and Module Information Files (MIFs)

The CIF file is generated with the application framework created by the Brew MP Wizard. The Brew MP Resource Compiler compiles the CIF into the MIF. The MIF contains information about the contents of the module, such as supported classes, supported applications, application privileges, application details (like the title and icon) and the author of the application. The MIF also specifies which classes are exported for use by other modules. All modules must contain a MIF. As the device starts up, the MIF describes the module to the device.