Page 1
User’s Guide Software Development Kit (SDK) for 5080, 5180, and 5380 Decoded Miniature Image Scan Engines...
Page 2
Hand Held Products. Hand Held Products shall not be liable for technical or editorial errors or omissions contained herein; nor for incidental or consequential damages resulting from the furnishing, performance, or use of this material.
Table of Contents Chapter 1 - Introduction Features of the 5X80 SDK ... 1-1 Target Operating Systems for the 5X80 SDK... 1-1 Interface Diagram... 1-2 5X80 SDK Library Files ... 1-2 5X80 SDK API Library Summary... 1-3 Data Types, Structures, and Enumerated Types ... 1-5 Chapter 2 - API Function Descriptions hhpAcquireImage ...
Page 4
Chapter 3 - Enumerated Types and Definitions Error Codes ...3-1 Setup Type Enumerated Type...3-2 Symbology ID Enumeration ...3-2 Supported OCR Fonts ...3-3 Image Formats...3-3 Compression Mode Formats ...3-4 Capture Illumination Duty Cycle ...3-4 Auto Exposure Type ...3-4 Gain Values Enum ...3-4 Frame Rates Enum ...3-4 Beeper Volume Enum ...3-5 Decoder Mode Enum ...3-5...
Page 5
Chapter 6 - Program Samples Configuration Management ...6-1 Barcode Capture ...6-2 Image Capture...6-5 Chapter 7 - Customer Support Technical Assistance ...7-1 Online Technical Assistance ...7-1 5X80 Series Software Development Kit (SDK) User’s Guide...
Page 6
5X80 Series Software Development Kit (SDK) User’s Guide...
• A single API is used for all Hand Held Products decoding engines. The libraries for all engines are identical for a given host platform. There are different libraries for each platform, but the API interface is the same for all of them, so you only need to learn a single API.
Interface Diagram The following diagram shows the interface between the 5X80 SDK and the Image Engine: SDK Driver Interface Layer - hhpImgrSdk.dll SDK API Interface Layer - commDrv.dll SDK API Interface Layer - commDrv.dll 5X80 SDK Library Files The SDK API and SDK communications layers are provided in the dynamic link libraries, hhpImgrSdk.dll and commDrv.dll, respectively.
5X80 SDK API Library Summary The following is a summary of the API functions. The full description of each function is found on the page noted. Core Functions Core Function Error Management Function hhpGetErrorMessage Connection Functions These functions open, close, and verify a connection to an imager. hhpConnect hhpDisconnect hhpEngineConnected...
Core Functions (Continued) Core Function hhpReadImagerCapabilities hhpReadEngineInfo hhpSetConfigItemToDefaults hhpWriteConfigItem hhpWriteConfigStream Symbology Configuration Functions These functions allow you to read and set the symbology configurations. hhpEnableDisableSymbology hhpReadSymbologyConfig hhpReadSymbologyRangeMaxMin hhpSetSymbologyDefaults hhpWriteSymbologyConfig Barcode Capture Functions The 5X80 SDK captures barcodes from imagers that have hardware triggers or some other non-SDK initiated barcode captures without having to poll the imager to see if there is any data to read.
Core Functions (Continued) Core Function hhpGetLastImage Intelligent Imaging (Signature Capture) Functions Intelligent imaging is barcode capture combined with an image window capture. The image window is cut from the same image used to capture a barcode. This is how the SDK provides the ability to capture a signature associated with a barcode. In fact, a successful barcode capture is required before the intelligent image window is sent by the imager.
Page 12
Windows Data Types (Continued) SDK Enumerated Types Beep Options Enumeration (not an enumerated type) that can be used with an hhpSendActionCommand. Enumerated type for specifying the form of compression (if any) to use when transferring an Compression_t image from the imager to the SDK. See Enumerated type to specify that the configuration structure is being sent to the Read/Write ConfigItems_t config item functions.
SDK Structure Types A full description of the SDK structure types can be found in Important: Make sure to set the structure members dwStructSize and dwMask. Individual Symbology Structures All symbologies, except OCR, use either SymFlagsOnly_t or SymFlagsRange_t for configuration. There is a define for each symbology (except OCR) that points to one of these two structures.
Page 14
1 - 8 5X80 Series Software Development Kit (SDK) User’s Guide...
API Function Descriptions The following is an alphabetic listing of each API function with its complete description and a prototype for each function. All API functions (with the exception of hhpEngineConnected 3-1 for the result code values. hhpAcquireImage This function causes the imager to capture an image and transfer it to the host. Values to be used from the structures are specified by setting the appropriate bit mask for each item in the structure’s mask member.
Note: Since the HHP_INTEL_IMG structure requires that image offsets and size be specified in barcode units, the HHP_INTEL_IMG structure has a size member that allows you to specify (in pixels) the maximum allowable width and height for the returned image. hhpAcquireIntelligentImage ( Syntax PHHP_INTEL_IMG...
hhpCaptureRawBarcode This function causes the imager to capture images and attempt to decode them. Decoded data returned is unmodified 8 bit ASCII data. Barcode capture can be synchronous or asynchronous. Synchronous capture is specified by setting the bWait parameter hhpCaptureRawBarcode to TRUE. In this case, the function will not return until a barcode is read, an error occurs, or the decode timeout is reached.
hhpDisconnect Closes the communications port and stops the read data thread. Syntax hhpDisconnect( void hhpEnableDisableSymbology Enables/disables an individual symbology or all symbologies. hhpEnableDisableSymbology ( Syntax int nSymId, BOOL Parameter Description nSymId One of the symbology enumerated types, e.g., SYM_CODE39, SYM_OCR, or SYM_ALL to enable/ disable all symbologies.
hhpGetErrorMessage This function returns a text message describing the meaning of a Result_t error code. See descriptions. hhpGetErrorMessage ( Syntax Result_t PTCHAR int nMaxChars Parameter Description nErrorCode Error code returned from one of the other 5X80 SDK functions. ptcErrMsg TCHAR buffer to hold error message string. nMaxChars Maximum number of characters that can fit in ptcErrorMsg including NULL.
hhpRawAcquireIntelligentImage Captures a portion of the image in which a barcode is decoded. The position of the image is specified relative to the center of the barcode. This function differs from (untranslated) byte data array. Note: Since the HHP_INTEL_IMG structure requires that image offsets and size be specified in barcode units, the HHP_INTEL_IMG structure has a size member that allows you to specify (in pixels) the maximum allowable width and height for the returned image.
SERIAL_PORT_CONFIG If using a serial connection imager, this returns the serial port setup IMAGE_ACQUISITION IMAGE_TRANSFER SEQUENCE_CONFIG ALL_CONFIG pStruct Pointer to the appropriate structure based on parameter “item:” HHP_BEEPER HHP_TRIGGER HHP_DECODER_CONFIG HHP_POWER_SETTINGS HHP_VERSION_INFO HHP_SYM_CONFIG HHP_SERIAL_PORT_CONFIG HHP_IMAGE_ACQUISITION HHP_IMAGE_TRANSFER HHP_SEQUENCE HHP_CONFIG hhpReadConfigStream Reads the full imager configuration as a single stream of data into a buffer. The buffer contains all the configuration items in an ASCII stream so that it can be written to a disk for storage.
Note: As with all other HHP structures, the dwStructSize member of the structure must be set before calling this function. (Set to sizeof (HHP_IMAGER_CAPS).) hhpReadImagerCapabilities ( Syntax HHP_IMAGER_CAPS Parameter Description pImgrCaps Pointer to the HHP_IMAGER_CAPS structure. hhpReadSymbologyConfig Reads configuration items for a single symbology or for all symbologies. Individual items to be read are specified by adding the appropriate mask bit (OR it) to the mask member of the structure to which it belongs.
hhpSendActionCommand This command allows the application to modify some of the imager hardware states. The items that can be modified include turning the illumination LEDs on/off, turning the aimer LEDs on/off, or causing the device’s beeper to beep/double beep. hhpSendActionCommand ( Syntax HHP_ACTION actionCmd, int nVal )
hhpSetAsyncMethods hhpSetAsyncMethods sets the methods by which the caller wishes to be notified upon receipt of a barcode or image. hhpSetAsyncMethods ( Syntax HANDLE HWND HHP_EVENT_CALLBACK Parameter Description hEventHandle Handle to a Windows Event. The event should specify manual reset. hWndHandle Handle to the application window that should receive the SDK defined message WM_HHP_EVENT_HWND_MSG.
hhpSetHardwareLineDllFileName The SDK API provides the ability to provide OEM device-dependent extensions to support the imager hardware sleep lines, and hardware trigger and/or special COM port driver configuration/initialization. The definitions and function prototype are located in the header file OemDll.h. Also see OEM-Configurable SDK Functionality hhpSetHardwareLineDllFileName ( Syntax...
hTransferNotifyHwnd Handle to the window that is to receive the transfer update messages. The message is sent when the percentage changes by more than 1%. The window associated with the handle should hook the WM_HHP_PROGRESS_HWND_MSG message. After file transfer is complete and while the imager is storing the new code in flash, the message WM_HHP_IMAGER_FLASHING is sent to the window HWND (if valid).
HHP_IMAGE_ACQUISITION HHP_IMAGE_TRANSFER HHP_SEQUENCE HHP_CONFIG hhpWriteConfigStream Writes an entire data stream of programmable parameters to the device. hhpWriteConfigStream ( Syntax PBYTE int nLen Parameter Description puchCfgStream Buffer to hold the raw imager configuration stream. nMaxLen Maximum number of bytes that fit in buffer puchCfgStream. hhpWriteSymbologyConfig Writes configuration items for a single symbology or for all symbologies.
Page 28
Symbology Code 32 Pharmaceutical (PARAF) Code 39 Code 49 Code 4CB (4 State Customer Barcode) Code 93 Data Matrix EAN-8 EAN-13 EAN•UCC Composite Interleaved 2 of 5 ISBT 128 Japanese Post KIX (Netherlands) Post Korea Post Matrix 2 of 5 MaxiCode MicroPDF417 PDF417...
Error Codes (Continued) RESULT_ERR_SHIP_IMAGE_FAILED RESULT_ERR_SMARTIMAGETOOLARGE RESULT_ERR_SYMBOLOGY_HAS_NO_RANGE RESULT_ERR_UNICODE_UNSUPPORTED RESULT_ERR_UNSUPPORTED RESULT_ERR_UPGRADE RESULT_ERR_USER_CANCEL RESULT_ERR_WRONGRESULTSTRUCT Setup Type Enumerated Type SETUP_TYPE_CURRENT, SETUP_TYPE_DEFAULT = 0, Symbology ID Enumeration Total number of supported NUM_SYMBOLOGIES symbologies SYM_ALL=100 All active symbologies SYM_AUSPOST, Australian Post SYM_AZTEC = 0, Aztec Code SYM_BPO, British Post SYM_CANPOST,...
USB serial 5080 VGA imager with internal decoder. Serial (RS-232) 5080 VGA imager with internal decoder and PSOC. USB serial 5080 VGA imager with internal decoder and PSOC. Serial (RS-232) 5080 imager with internal decoder. USB serial 5080 imager with internal decoder.
Structures and Mask Definitions Important: All structures have a dwStructSize member that MUST BE SET before calling any of the 5X80 SDK API functions. This insures that the proper structure has been passed to the function being called. Most structures have a dwMask member. This specifies which structure members are active (to be read or written). Select structure items by ORing the individual structure masks for each of the items you wish to be active together.
Page 38
#define SYMBOLOGY_POSICODE_LIMITED_2 #define SYMBOLOGY_CODABAR_CONCATENATE Flags for OCR are reused, since none of the other flags apply to OCR. #define SYMBOLOGY_ENABLE_OCR_A #define SYMBOLOGY_ENABLE_OCR_B #define SYMBOLOGY_ENABLE_OCR_MONEY #define SYMBOLOGY_ENABLE_OCR_MICR Symbology structure sets masks to specify which items of config structure are to be set or read. #define SYM_MASK_FLAGS #define SYM_MASK_MIN_LEN #define SYM_MASK_MAX_LEN...
Page 39
Min/Max barcode lengths for symbologies that have length settings: Code Aztec China Post Codabar Codablock F Code 11 Code 16K Code 128 Code 2 of 5 Code 39 Code 49 Code 93 DataMatrix EAN•UCC Composite IATA Code 2 of 5 Interleaved 2 of 5 Korean Post Matrix 2 of 5...
Page 40
TCHAR tcGroupH[ MAX_GROUP_G_LEN ]; TCHAR tcCheckChar[ MAX_CHECK_CHAR_LEN ]; Check character string. } SymCodeOCR_t, *PSymCodeOCR_t; Structure of all Symbology Structures There is one structure for each symbology. This info is stored in imager config. Define aliases for each symbology structure: #define AZTEC_T #define MESA_T #define CODABAR_T #define CODE11_T...
Page 41
typedef struct _tagSymCfg DWORD dwStructSize; Set to sizeof( SymCfg_t ); Linear Codes - Flags supported for this code: CODABAR_T codabar; CODE32_T code32; COUPONCODE_T couponCode; TRIOPTIC_T triopticCode; CODE11_T code11; CODE128_T code128; CODE39_T code39; CODE49_T code49; CODE93_T code93; COMPOSITE_T composite; EAN8_T ean8; EAN13_T ean13;...
4 - 6 None (See SymCodeOCR_t) 4096 Size of decode structure. decoded message data AIM Id of symbology Hand Held Products Id of symbology Modifier characters length of the decoded message Size of decode structure Decoded message data AIM ID of symbology...
DWORD dwCompressionFactor; DWORD dwEdgeEhancement; DWORD dwGammaCorrection; DWORD dwTextEnhancement; BOOL bInfinityFilter; BOOL bFlipImage; BOOL bNoiseFilter; Transfer time only, not stored in imager: HWND hTransferNotifyHwnd; PDWORD pdwTransferPercent; } HHP_IMAGE_TRANSFER, *PHHP_IMAGE_TRANSFER; Data structure for captured image: hhpAcquireImage(), hhpGetLastImage() and hhpGetAsyncResult(). Not stored in im- ager.
Page 48
These are used to notify on suspend (WinCE Suspend) – Not stored in imager: HANDLE hPowerOffHandle; HWND hPowerOffHwnd; } HHP_POWER_SETTINGS, *PHHP_POWER_SETTINGS; Version setting item masks – Items are read only: #define VERMASK_SDK_API #define VERMASK_IMAGER_FIRMWARE #define VERMASK_IMAGER_PART_NUM #define VERMASK_IMAGER_BOOT_CODE #define VERMASK_IMAGER_DEVICE_TYPE #define VERMASK_ALL Revision information: #define MAX_VERSION_STRING_LEN64...
Page 49
Serial (RS-232) 4080 imager with internal decoder. USB serial 4080 imager with internal decoder Incorporated 4000 imager. USB serial 5080 VGA imager with internal decoder. Serial (RS-232) 5080 VGA imager with internal decoder and PSOC. Incorporated 5000 VGA imager. Serial (RS-232) 5080 imager with internal decoder.
Page 50
4 - 14 5X80 Series Software Development Kit (SDK) User’s Guide...
OEM-Configurable SDK Functionality The 5X80 accommodates a variety of PDA/PDT, static mount, and "gun" type installations, so the 5X80 SDK has included the flexibility to modify some SDK behaviors. You can provide a DLL that affords the SDK access to the hardware trigger, hardware sleep lines, and access to the open driver handle and registry entries, which can be used to specify high speed baud rates (greater than 115200).
Registry Entries There are two registry entries used to modify the SDK default behavior. The values are both located in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Hand Held Products\MatrixDemos. Baud Rate The SDK will not normally allow high speed serial connections (connections greater than 115200 baud) unless it recognizes the driver name in the registry.
Barcode Capture Sample 3 - A synchronous barcode capture HHP_DECODE_MSG decodeInfo; TCHAR tcErrMsg[ 128 ]; Result_t nResult = RESULT_ERR_INTIALIZE; // Make sure to set the structure size! decodeInfo.dwStructSize = sizeof( HHP_DECODE_MSG ); // Call the SDK function to capture a barcode setting the bWait parameter to TRUE, 6 second timeout.
Page 55
_tprintf( _T(“Symbol Modifier: %c\n”),decodeInfo.chSymModifier ); else hhpGetErrorMessage( _tprintf( _T(“Capture Barcode Returned: %s\n”),tcErrMsg ); Sample 5 - An asynchronous barcode capture message notification Note: You must hook the message WM_HHP_EVENT_HWND_MSG in your message loop to receive a barcode event notification. In this example, the message is hooked to call OnEventMsg. TCHAR tcErrMsg[ 128 ];...
Page 56
Sample 6 - An asynchronous barcode capture using Callback function // Message Handler function BOOL CALLBACK EventCallback(HHP_EVENT_TYPE eventType,DWORD dwBytes ) HHP_DECODE_MSG TCHAR Result_t // Verify the event type is barcode if( eventType == HHP_BARCODE_EVENT ) // Make sure to set the structure size! decodeInfo.dwStructSize = sizeof( HHP_DECODE_MSG );...
Image Capture Sample 7 - A synchronous image capture // Capture image specifies: for capture - Photo Mode and Lights On During Frames. for Transfer - Subsample value of 1 and Lossless transfer. Note: You don’t really have to pass anything except the HHP_IMAGE structure as long as you want the imager config settings for capture and transfer.
Page 58
_tprintf( _T(“Image Capture Failed: %s\n”),tcErrMsg ); // Remember to delete your buffer. delete [ ] image.puchBuffer; Sample 8 - An asynchronous image capture using Windows Messaging Note: You must hook the message WM_HHP_PROGRESS_HWND_MSG in your message loop to receive a barcode event notification.
Page 59
LRESULT OnProgressMsg( WPARAM wParam,LPARAM lParam ) DWORD dwBytesSoFar = wParam; DWORD dwBytesToRead = lParam; return( 0 ); // Message Handler for image acquisition ended function (can be result of a failure as well) LRESULT OnEventMsg( WPARAM wParam,LPARAM lParam ) hhpEventTye_t eventType = (hhpEventType_t)wParam; DWORD dwBytes = lParam;...
Page 60
6 - 8 5X80 Series Software Development Kit (SDK) User’s Guide...
Customer Support Technical Assistance If you need assistance with the SDK, please call your Distributor or the nearest Hand Held Products technical support office: North America/Canada Telephone: (800) 782-4263, option 4 (8 a.m. to 6 p.m. EST) Fax number: (315) 685-4960 E-mail: natechsupport@handheld.com...
Page 62
7 - 2 5X80 Series Software Development Kit (SDK) User’s Guide...
Page 64
Hand Held Products, Inc. 700 Visions Drive P.O. Box 208 Skaneateles Falls, NY 13153-0208 ™ 5X10-80SDK-UG Rev C 9/07...