Intermec ck1 Guía De Referencia

Descargar
Página de 390
Chapter 2 — Configuring the CK1 System 
CK1 SDK Programmer’s Reference Manual 
95 
 * ---------------------------- 
 * Behavior of this sample code 
 * ---------------------------- 
 * Input parameters: 
 * 
$1: partition/image name (kernel/rootfs/usrlocal) 
 *  
$2: vendor name 
 *  
$3: product name 
 * 
$4: version serial number (YY.MM.DD) 
 * 
 * This program will check: 
 *    (1) the partition/image name is correct 
 * 
(2) the vendor name is correct 
 * 
(3) the product name is correct 
 * 
(4) the version is newer 
 *  
 * ----------------------------- 
 * Return Value: 
 * ----------------------------- 
 * 0: if everything is ok and the version is newer 
 * 1: if wrong 
partition/image
 or wrong vendor or wrong product or old version 
 * ----------------------- 
 */ 
 
#include <stdio.h> 
#include <string.h> 
#include <eslib_remote_upgrade.h> 
 
#define  arg_num  (5) 
 
//#define DEBUG_DO_UPGRADE 
 
int main(int argc, char *argv[]) 

 
char *vendor, *product, *version; 
 
 
vendor = NULL; 
 
product = NULL; 
 
version = NULL; 
 
 
if(argc < arg_num) { 
 
 
printf("Usage: checkVersion <image name|partition name>\n"); 
 
 
printf("                    <vendor name>\n"); 
 
 
printf("                    <product name>\n"); 
 
 
printf("                    <version serial number 
(YY.MM.DD)>\n"); 
  return 
0; 
 
} else { 
#ifdef DEBUG_DO_UPGRADE 
 
 
   int 
i; 
 
 
 
for(i=0; i<arg_num; i++) printf("argv[%d]=%s\n", i, 
argv[i]); 
 
 
#endif 
 } 
 
 
vendor = (char *) RUGetVendor(argv[1]); 
 
product = (char *) RUGetProduct(argv[1]);