rattail-palm/src/ScanMgrDef.h

238 lines
9 KiB
C
Raw Normal View History

2012-02-15 19:34:31 -06:00
/******************************************************************************
*
* Barcode Scanner Common Defines.
*
* Copyright (c) 2006 Janam Partners LLC. All rights reserved.
*
* File: ScanMgrDef.h
*
* Release: Palm OS 5.x
*
* Description: Reserved for backward compatible
* Common defines for the scanner library
* Extended defines are in JanamExtendedDef.h
* History:
* Version 1.0 PT, JL Oct, 2006
*
*****************************************************************************/
#ifndef __SCANMGRDEF_H__
#define __SCANMGRDEF_H__
//#pragma once
#include "JanamExtendedDef.h"
/*******************************************************************
* Symbol unit hardware token (checked in ScanIsPalmSymbolUnit)
*******************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#define SymbolROMToken 'scnr'
//-----------------------------------------------------------------------------
//Defines for Backward Compatible
//Beep Frequecy and Duration
#define MIN_BEEP_DURATION 0
#define MAX_BEEP_DURATION 10000
#define MIN_BEEP_FREQUENCY 0
#define MAX_BEEP_FREQUENCY 15000
#define MIN_UPCEAN_REDUNDANCY 2
#define MAX_UPCEAN_REDUNDANCY 20
#define MIN_LASER_ON_TIME 5
#define MAX_LASER_ON_TIME 99
#define MAX_AIM_DURATION 99
#define MAX_TIMEOUT_BETWEEN_SYMBOL 10
#define MAX_DECODE_LED_ON_TIME 100
//-----------------------------------------------------------------------------
//Beep and Scanner Range Values
#define SHORT_BEEP_DUR 0x20
#define MEDIUM_BEEP_DUR 0x21
#define LONG_BEEP_DUR 0x22
#define HIGH_FREQ 0x23
#define MEDIUM_FREQ 0x24
#define LOW_FREQ 0x25
#define DECODE_BEEP_DUR 0x27
#define DECODE_BEEP_FREQ 0x28
//-----------------------------------------------------------------------------
//Error Code Returns
#define STATUS_OK 0
#define NOT_SUPPORTED -2
#define COMMUNICATIONS_ERROR -3
#define BAD_PARAM -4
#define BATCH_ERROR -5
#define ERROR_UNDEFINED -6
//-----------------------------------------------------------------------------
//Triggering Modes
#define LEVEL 0x00
#define PULSE 0x02
#define HOST 0x08
//-----------------------------------------------------------------------------
//Enable or Disable
#define DISABLE 0x00
#define ENABLE 0x01
//-----------------------------------------------------------------------------
//Security Levels
#define SECURITY_LEVEL0 0x00
#define SECURITY_LEVEL1 0x01
#define SECURITY_LEVEL2 0x02
#define SECURITY_LEVEL3 0x03
#define SECURITY_LEVEL4 0x04
//-----------------------------------------------------------------------------
//Supplementals
#define IGNORE_SUPPLEMENTALS 0x00
#define DECODE_SUPPLEMENTALS 0x01
#define AUTODISCRIMINATE_SUPPLEMENTALS 0x02
//-----------------------------------------------------------------------------
//Transmit Check Digit
#define DO_NOT_TRANSMIT_CHECK_DIGIT 0x00
#define TRANSMIT_CHECK_DIGIT 0x01
//-----------------------------------------------------------------------------
//Preamble
#define NO_PREAMBLE 0x00
#define SYSTEM_CHARACTER 0x01
#define SYSTEM_CHARACTER_COUNTRY_CODE 0x02
//-----------------------------------------------------------------------------
//Discrete Length
#define ANY_LENGTH 0x00
#define ONE_DISCRETE_LENGTH 0x01
#define TWO_DISCRETE_LENGTHS 0x02
#define LENGTH_WITHIN_RANGE 0x03
//-----------------------------------------------------------------------------
//Check Digit Verification
#define DISABLE_CHECK_DIGIT 0x00
#define USS_CHECK_DIGIT 0x01
#define OPCC_CHECK_DIGIT 0x02
//-----------------------------------------------------------------------------
// MSI Plessy Check Digits
#define ONE_CHECK_DIGIT 0x00
#define TWO_CHECK_DIGITS 0x01
//-----------------------------------------------------------------------------
// MSI Plessey check digit algorithms
#define MOD10_MOD11 0x00
#define MOD10_MOD10 0x01
//-----------------------------------------------------------------------------
// Aimer Code ID
#define AIM_CODE_ID_CHARACTER 0x01
#define SYMBOL_CODE_ID_CHARACTER 0x02
//-----------------------------------------------------------------------------
// Prefix and Suffix Values
#define PREFIX_SUFFIX_VALUES_P 0x69
#define PREFIX_SUFFIX_VALUES_S1 0x68
#define PREFIX_SUFFIX_VALUES_S2 0x6A
//-----------------------------------------------------------------------------
// Scan Data Formats
#define DATA_AS_IS 0x00
#define DATA_SUFFIX1 0x01
#define DATA_SUFFIX2 0x02
#define DATA_SUFFIX1_SUFFIX2 0x03
#define PREFIX_DATA 0x04
#define PREFIX_DATA_SUFFIX1 0x05
#define PREFIX_DATA_SUFFIX2 0x06
#define PREFIX_DATA_SUFFIX1_SUFFIX2 0x07
//-----------------------------------------------------------------------------
// Scan Angles
#define SCAN_ANGLE_WIDE 0xB6
#define SCAN_ANGLE_NARROW 0xB5
//-----------------------------------------------------------------------------
// Barcode data types returned
#define BCTYPE_NOT_APPLICABLE 0x00
#define BCTYPE_CODE39 0x01
#define BCTYPE_CODABAR 0x02
#define BCTYPE_CODE128 0x03
#define BCTYPE_D2OF5 0x04
#define BCTYPE_IATA2OF5 0x05
#define BCTYPE_I2OF5 0x06
#define BCTYPE_CODE93 0x07
#define BCTYPE_UPCA 0x08
#define BCTYPE_UPCA_2SUPPLEMENTALS 0x48
#define BCTYPE_UPCA_5SUPPLEMENTALS 0x88
#define BCTYPE_UPCE0 0x09
#define BCTYPE_UPCE0_2SUPPLEMENTALS 0x49
#define BCTYPE_UPCE0_5SUPPLEMENTALS 0x89
#define BCTYPE_EAN8 0x0A
#define BCTYPE_EAN8_2SUPPLEMENTALS 0x4A
#define BCTYPE_EAN13_5SUPPLEMENTALS 0x8B
#define BCTYPE_EAN8_5SUPPLEMENTALS 0x8A
#define BCTYPE_EAN13 0x0B
#define BCTYPE_EAN13_2SUPPLEMENTALS 0x4B
#define BCTYPE_MSI_PLESSEY 0x0E
#define BCTYPE_EAN128 0x0F
#define BCTYPE_UPCE1 0x10
#define BCTYPE_UPCE1_2SUPPLEMENTALS 0x50
#define BCTYPE_UPCE1_5SUPPLEMENTALS 0x90
#define BCTYPE_CODE39_FULL_ASCII 0x13
#define BCTYPE_TRIOPTIC_CODE39 0x15
#define BCTYPE_BOOKLAND_EAN 0x16
#define BCTYPE_COUPON_CODE 0x17
#define BCTYPE_ISBT128 0x19
//-----------------------------------------------------------------------------
#define EXTENDED_DATA_FLAG 0x01
typedef enum tagSymbolEvent
{
scanDecodeEvent = 0x7fffU + 0x800, // A decode event has finished
scanBatteryErrorEvent, // Low Battery
scanTriggerEvent, // A scan attempt was initiated
s24BatteryErrorEvent,
symbolRFUA,
symbolRFUB,
symbolRFUC,
symbolRFUD,
symbolRFUE,
symbolRFUF,
symbolRFUG,
symbolRFUH,
WanLowBatteryEvent,
WanBatteryErrorEvent,
lastSymbolEvent
} SymbolEvents;
enum scanMgrErr
{
scanMgrErrParam = appErrorClass+1,
scanMgrErrNotOpen,
scanMgrErrStillOpen,
scanMgrErrMemory,
scanMgrErrLowBatt
};
#ifdef __cplusplus
}
#endif
/*******************************************************************
* end of file *
*******************************************************************/
#endif // __SCANMGRDEF_H__