wavecom package[1.0] named "Release 7.43.3 cus Q26RD / SL6087" version "7.43.3.201201300737"  by "Wavecom"
SHAREDVARS
{
    /* The following variables can be set through
     * the downloader's OLE interface to tailor
     * the download process */

    /* boolean: to be set to bypass the firmware and
     * eeprom files download stage */
    integer NO_DOWNLOAD;

    /* integer: to be set to the required value (in KBytes) of A&D Dota volume */
    integer DOTA_VOLUME_SIZE;

    /* when non-null, customized size in KB allocated for application
     * objects (ADL Flash API) */
    integer FLASH_APPLICATION_QUOTA;

    /* when non-null, customized number of objects entries (max. 7936)
     * Note: this pool of entries is shared by both the firmware and
     * the application */
    integer FLASH_ENTRIES_COUNT;

    /* name of the targeted Wireless CPU/Wireless Microprocessor
     * (e.g. "wmp100" or "wmp150") */
    string WCPU_TYPE;

    /* to enable OpenAT application after download */
    integer START_APPLICATION;    
}
{
   if (RAM_SIZE < 0x100000) /* check that there is at least 1MByte of RAM */
      call die("The RAM is too small");
  
    /* Name of the module file (PNMKT) to download.
     * Either built from the WCPU_TYPE variable or from a
     * selection in GUI context */
    string strModuleFile;

    /* Install the Dota Manipulation Plug-In */
    file: "dotadwl.plg";

    /* Carry out the erase operations */
    if (BOOL_ERASE_OAT)
        exec: ERASE_OAT "Erasing the Open AT application";

    if (BOOL_ERASE_OBJ)
        exec: ERASE_OBJ "Erasing application data";
    

    /* Test the presence of the pro-dwl.wpb */
    integer boolProDwlInFlash = isFirmwareInstalled("pro-dwl.wpb");

    /* Ask the GUI user questions about the download process */
    if (isGui())
    {
        /* Select the Wireless CPU */
        call promptChoice("Please select the Wireless CPU type",
            strModuleFile, "fxt009.e2p","q2686RD.e2p","q2687RD.e2p","q26SM603RD.e2p","q26SM703RD.e2p","sl6087.e2p");

        /* DOTA volume customization */
        if (promptBoolean("Do you want to resize the A&D Dota volume ?"))
        {
            DOTA_VOLUME_SIZE = promptInteger("Enter the required size in Kbytes");
        }
        /* RAI area customization */
        if (promptBoolean("Do you want to customize the flash objects area (ADL Flash API) ?"))
        {
            FLASH_APPLICATION_QUOTA = promptInteger("Enter the required size in Kbytes");
            if (promptBoolean("Do you want to modify the default max number of entries?"))
            {
                FLASH_ENTRIES_COUNT = promptInteger("Enter the new max number");
            }
        }

        if (boolProDwlInFlash)
        {
            NO_DOWNLOAD = !promptBoolean("The firmware is already present in flash memory: download it anyway?");
        }
     
    }

  
    /* Now proceeding with files download */
    if (! NO_DOWNLOAD)
    {
        /* build the PNMKT file name when required */
        if (strlen(strModuleFile) == 0)
        {
          if (strlen(WCPU_TYPE) == 0)
            call die("The variable CPU_TYPE must be set");
          call concatenate(strModuleFile, "module/", WCPU_TYPE, ".e2p");
        }
        else /* strModuleFile selected through GUI */
          call concatenate(strModuleFile, "module/", strModuleFile);

        /* skip download in automation mode unless required */
        if (isGui() || (!boolProDwlInFlash))
        {
            file: "pro-dwl.wpb";
            file: "w.e2p";
            file: strModuleFile;            
            
            /* no download of "wonce.e2p" for this release in customer WPK */
            
            /*Specific for R7.43.A3 SL6087/Q26RD : deltavxx contains TaOffsets fields */
            file: "e2p/deltavxx.e2p";
            file: "e2p/Q26RD_SL6087_RFSig_GSM_v06.e2p";
            file: "e2p/Q26RD_SL6087_RFSig_EDGE_v06.e2p";
            
            if (FLASH_SIZE > 0x400000)
               file: "e2p/mem64.e2p";
            else
               file: "e2p/mem32.e2p";
        }
    }  

    if(DOTA_VOLUME_SIZE > 0)
        exec: dotadwl/PartitionDota(DOTA_VOLUME_SIZE) "Resizing the A&D Dota volume";

    if (FLASH_APPLICATION_QUOTA || FLASH_ENTRIES_COUNT)
    {
        /* Download the RAIDWL to manipulate RAI related EEPROM parameters */
        file: "raidwl.plg";
        if (FLASH_ENTRIES_COUNT)
            exec: raidwl/resize_raispace(FLASH_APPLICATION_QUOTA, FLASH_ENTRIES_COUNT) "Resizing objects space";
        else
            exec: raidwl/resize_raispace(FLASH_APPLICATION_QUOTA) "Resizing objects space";
    }

    /* Download any other file that might have been
     * selected in the GUI or through the OLE
     * automation routines */
    call downloadOtherFiles();
    exec: FLASH_REMAP "Commiting the changes in flash memory";
    
    /* Enable customr application if neecessary*/
    if (START_APPLICATION) {
        file: "openctrl.e2p";
    }
}
