C Language Development Kit/Functions/DownloadApplication

From OptiWiki

Jump to: navigation, search
Description This function switches the terminal into a mode in which the user can install

a new application. An application loader on the PC, such as APPLOAD.EXE, can then be used to install a new application.

Syntax
void downloadapplication(int port);
Arguments
int port
port specifies which serial communications port is going to be used. See the table below for details:
COM0 Port for the direct cable connection, available for PHL1700 and PHL2700
COM1 Port for the IrDA interface, available for all terminals, except the DWT7133.
COM2 Port for the cradle, available on all terminals.
Returns None
Remarks WARNING!

The current application in the handheld terminal is erased, before downloading starts. If the download process is interrupted accidentally, the handheld terminal is left in the system menu, without an application in memory.

The function runapplfromfile() is a better option. It loads an application from a file that is residing on the handheld terminal.

This function closes any open communication port.

Example
#include "lib.h"
#include <stdio.h>
 
void main( void )
{
    printf("\fFor download\npress ENT key.");
    delay( 100 );
    resetkey();
 
    for(;;)
    {
        while( getchar() != ENT_KEY )
            idle();
 
        downloadapplication( COM1 ); // use IrDA / Cradle
        printf("\fDownload didn't\nsucceed !");
        delay( 100 );
        printf("\fTry again!\nPress ENT key.");
        delay( 100 );
        resetkey();
    }
}


Views
Personal tools