Metrologic Optimus S Programming Manual page 41

"c" programming guide
Table of Contents

Advertisement

Description
This routine copies the desired program (Prog) in flash memory from its
residence location to the active area, and thus makes it become the active
program. The original file system may be kept or cleared (mode).
KEEP_FILE_SYSTEM
CLEAR_FILE_SYSTEM 1
None
Return
See Also
LoadProgram, ProgramInfo, ProgramManager
DownLoadProgram
Purpose
To download a user program (.SHX) to SRAM.
Syntax
int DownLoadProgram (char *filename, int comport, int baudrate);
char *filename;
int comport;
int baudrate;
Example
val = DownLoadProgram (filename_buffer, 1, BAUD_115200);
/* download user program via COM1 at 115200 bps and return file name to
filename_buffer */
Description
This routine is used to download a user program to the file system (SRAM).
If successful, it returns 1.
Return
On error, it returns 0.
Otherwise, it returns -1 to indicate the action is aborted.
See Also
UpdateBank, UpdateUser
Chapter 3 Terminal Specific Function Library
The original program resided in the active area will then be replaced by the
new program.
The POWER key is disabled to protect the system while replacing the
program.
This routine will not return, however, once the execution continues
running to the next instruction, it means the operation of this routine fails.
If successful, the new program will be activated immediately.
/* pointer to a buffer where filename of the program is stored */
A file name can be 8 bytes at most, the null character not included.
If its file name is identical to an existing program, the execution will fail.
For the Optimus R, it is necessary to set the communication type of the
specified port before calling this routine, i.e. SetCommType(1, 0) for
Direct RS-232 or SetCommType(1, 2) for Cradle-IR. Download via IrDA
is allowed for LoadProgram() only, not for this routine.
0
/* COM1 or COM2 for transmission */
/* appropriate baud rate */
35

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents