Resources | Resources |




Module resource (ModRsc) is the most basic primitive, and it defines a resource that is made available to a Brew MP module. The type and id fields combined define a key that must be unique.


ModRsc is the basic building block in CIF/CAR files. Everything in CIF/CAR can ultimately be expressed as a ModRsc, but higher-ordered constructs are supplied such as SysRsc and Applet.

ModRsc { 
  id = 1001, 
  type = 1, 
  data = EncStringRscData(0xff, "my string"), 
  • id: A number up to 16 bits that identifies the particular resource.
  • type: Type of the resource; a number up to 16 bits. Types include String (0x0001), Object (0x0006), and Binary (0x5000). Other resource types may be available.
  • data: Associated resource data. A string value is accepted as is. Numbers are converted into a string of little-endian format. The functions in the Related Reference section help you work with resource data.

Example 1: In the CAR file define a resource string:

The prototype uses a raw resource ID, 1001. However, where there is a file such as MyResource.h that contains a friendly resource ID (which is easier to read than a raw resource ID)

#define IDS_MyString 1001

The CIF file that contains the ModRsc primitive can include MyResource.h, which provides a definition of the friendly resource ID. You can use either friendly resource IDs or raw resource IDs.

Include "MyResource.h"
Include "AEEEncodingTypes.h." -- Need to include to use AEE_ENC_XXX for data.
Include "AEEResType.h" -- Need to include to use RESTYPE_XXX for type.

ModRsc { 
  id = IDS_MyString, 
  data = EncStringRscData(AEE_ENC_UNICODE, "my string"),

Example 2: In the CIF file, specify the module's author name, copyright string, module version, and display settings:

include "AEEEncodingTypes.h." -- Need to include to use AEE_ENC_XXX for data
include "AEEResType.h"        -- Need to include to use RESTYPE_XXX for type

--Author name
ModRsc {
    id    = 6,  
    data  = EncStringRscData(AEE_ENC_UNICODE , "Steve"),

--Copyright String
ModRsc {
    id    = 7,  
    data  = EncStringRscData(AEE_ENC_UNICODE , "Qualcomm, Inc."),

--Module Version
ModRsc {
    id    = 8, 
    data  = EncStringRscData(AEE_ENC_UNICODE , "1.0.0"),

--To specify Display Settings
ModRsc {
    id    = 26, 
    data  = EncStringRscData(AEE_ENC_ISOLATIN1 , "display1=w:*,h:*,c:24,a:1,r:,v:1"),