Magtek ExpressCard 1000 Programming Reference Manual

Hide thumbs Also See for ExpressCard 1000:

Advertisement

Quick Links

ExpressCard 1000
PROGRAMMING REFERENCE MANUAL
WINDOWS API SPECIFICATIONS
MANUAL PART NUMBER 99875367-1
SEPTEMBER 2007
REGISTERED TO ISO 9001:2000
1710 Apollo Court
Seal Beach, CA 90740
Phone: (562) 546-6400
FAX: (562) 546-6301
Technical Support: (651) 415-6800
www.magtek.com

Advertisement

Table of Contents
loading

Summary of Contents for Magtek ExpressCard 1000

  • Page 1 ExpressCard 1000 PROGRAMMING REFERENCE MANUAL WINDOWS API SPECIFICATIONS MANUAL PART NUMBER 99875367-1 SEPTEMBER 2007 REGISTERED TO ISO 9001:2000 1710 Apollo Court Seal Beach, CA 90740 Phone: (562) 546-6400 FAX: (562) 546-6301 Technical Support: (651) 415-6800 www.magtek.com...
  • Page 2 Information in this document is subject to change without notice. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of MagTek, Inc. MagTek is a registered trademark of MagTek, Inc.
  • Page 3 CONDITIONS, AND RESTRICTIONS, PROMPTLY RETURN THE SOFTWARE PACKAGE AND ASSOCIATED DOCUMENTATION TO ABOVE ADDRESS ATTENTION: CUSTOMER SUPPORT. TERMS, CONDITIONS AND RESTRICTIONS MagTek, Incorporated (the "Licensor") owns and has the right to distribute the described software and documentation, collectively referred to as the "Software". LICENSE: Licensor grants you (the "Licensee") the right to use the Software in conjunction with MagTek products.
  • Page 4: Table Of Contents

    How To Communicate With Expresscard 1000 Using Web Browser ...............5 Get Device Status ..............................6 Get Device Information..............................7 How To Communicate With Expresscard 1000 Using Expresscard 1000 API ............8 API Functions ................................9 Software Flow For Document Processing.......................10 How To Process Card Using Expresscard 1000 API....................11 Process Options ..............................11...
  • Page 5 Parameters................................23 Return Values ..............................23 Remarks................................23 Example ................................23 MTECSDK_GetAttribute............................24 Parameters................................24 Return Values ..............................24 Remarks................................24 Example ................................25 MTECSDK_LogEnable............................26 Parameters................................26 Return Values ..............................26 Remarks................................26 Example ................................26 MTECSDK_SetLogFileHandle ..........................27 Parameters................................27 Return Values ..............................27 Remarks................................27 Example ................................27...
  • Page 7: Section 1. Overview

    Both options are effective in facilitating an interface to the device. However, there is probably an advantage in utilizing the MagTek API, as it will ensure that if any changes occur to the underlying hardware interface of the device (e.g. USB, RS-232, Firewire, etc…), the...
  • Page 8 ExpressCard 1000 Programming Reference This Programmer’s reference manual provides definitions for the API DLL interface. It is recommended that the application programmer review all of this information, so as to gain a broad perspective of the command, status, and functional aspects the device interface.
  • Page 9: Section 2. Expresscard 1000 Software Architecture

    SECTION 2. EXPRESSCARD 1000 SOFTWARE ARCHITECTURE The architecture of the system is shown in Figure 2-1. Descriptions of the terms and operations used follow the illustration. Application ‘C’ API XML to Key/Value and vice versa ExpressCard 1000 MSXML ‘C’ API to xfer data to a web Wininet.dll...
  • Page 10: Term Description

    MFC Win32 Internet Extension. wininet.dll, provide access to common Internet protocols, including Gopher, FTP, and HTTP. MTECSDK.dl uses wininet.dll to establish an Internet connection with ExpressCard 1000 device. It then communicates with ExpressCard 1000 using GET and POST requests provide by wininet.dll.
  • Page 11: How To Communicate With Expresscard 1000 Using Web Browser

    HOW TO COMMUNICATE WITH EXPRESSCARD 1000 USING WEB BROWSER ExpressCard 1000 can be accessed from an Internet Web browser using the IP address of the device. An example in using the IP address of the ExpressCard 1000 device to obtain device capabilities information is followed.
  • Page 12: Get Device Status

    ExpressCard 1000 Programming Reference GET DEVICE STATUS The following is an example in using the IP address of the ExpressCard 1000 device to obtain device status information. Assuming the ExpressCard 1000 device has IP address 192.168.10.100, type the following line in the address box of the Web browser. Internet Explorer is used in this example: https:// 192.168.10.100/Index.aspx?DeviceInformation=DeviceStatus...
  • Page 13: Get Device Information

    Section 2 - Architecture GET DEVICE INFORMATION The following is an example in using the IP address of the ExpressCard 1000 device to obtain device - usage information. Assuming the ExpressCard 1000 device has IP address 192.168.10.100, type the following line in the address box of the Web browser. Internet Explorer is used in this example: https:// 192.168.10.100/Index.aspx?DeviceInformation=DeviceInformation...
  • Page 14: How To Communicate With Expresscard 1000 Using Expresscard 1000 Api

    ExpressCard 1000 Programming Reference HOW TO COMMUNICATE WITH EXPRESSCARD 1000 USING EXPRESSCARD 1000 API The following table lists required files in order to use ExpressCard 1000 API: Files Location Description Windows folder This file contains a list of default ExpressCard 1000 connections MTECSDK.ini...
  • Page 15: Api Functions

    Section 2 - Architecture API FUNCTIONS Table 2-1 lists functions provided by MTECSDK.dll. Please refer to Section 3 for a complete description of these functions. Table 2-1. Functions NAME DESCRIPTION PAGE Get device name of all devices present in MTECSDK_GetDevice the system.
  • Page 16: Software Flow For Document Processing

    ExpressCard 1000 Programming Reference SOFTWARE FLOW FOR DOCUMENT PROCESSING Figure 2-4 illustrates the sequence of document processing. ExpressCard 1000 Present Successful Open Device Select desired options for document processing Send Options to Device Check Completion Status Close Device Figure 2-4. Software Flow for Card Processing...
  • Page 17: How To Process Card Using Expresscard 1000 Api

    ExpressCard 1000 device. MTECSDK_ProcessDoc 5. ExpressCard 1000 processes the document with the given process options and returns the result of the process operation. The result is stored in the third parameter of the function .
  • Page 18: Error Reporting

    ExpressCard 1000 Programming Reference ERROR REPORTING When a document is processed, if there is an error in the ExpressCard 1000 device or in the processing operation, the error is returned in the function . Use function MTECSDK_ProcessDoc MTECSDK_GetValue to retrieve the error information. The Windows XML Specification manual (PN 99875368) has a list of return codes and return messages from the ExpressCard 1000.
  • Page 19: Section 3. Expresscard 1000 Api

    SECTION 3. EXPRESSCARD 1000 API MTECSDK_GetDevice MTECSDK_GetDevice function returns the device name of the device present in the system. ULONG MTECSDK_GetDevice ( DWORD dwDeviceContext, char *pcDevName Parameters dwDeviceContext This is the device number of the device. This must be set to 1 to get the first device in the system. Increment it by 1 to get the next device name.
  • Page 20: Mtecsdk_Opendevice

    ExpressCard 1000 Programming Reference MTECSDK_OpenDevice MTECSDK_OpenDevice function opens the device with the given device name. ULONG MTECSDK_OpenDevice ( char *pcDevName Parameters pcDevName Pointer to null terminated string that specifies the name of the device to open. Use function MTECSDK_GetDevice to obtain the device name.
  • Page 21: Mtecsdk_Closedevice

    Section 3 – API DLL MTECSDK_CloseDevice MTECSDK_CloseDevice function closes the device with the given device name. ULONG MTECSDK_CloseDevice ( char *pcDevName Parameters pcDevName Pointer to null terminated string containing the name of the device to close. This is the device that is previously opened using function MTECSDK_OpenDevice.
  • Page 22: Mtecsdk_Processdoc

    ExpressCard 1000 Programming Reference MTECSDK_ProcessDoc MTECSDK_ProcessDoc function sends a card personalization request with the given process options to the given device name. When the device completes the request, the result of the card personalization operation is returned in the buffer pcDocInfo.
  • Page 23: Remarks

    Section 3 – API DLL Remarks If the function succeeds EC_ST_OK is returned. If there is no data returned from device, error EC_ST_PROCESS_DOC_FAILED is returned pcProcessOptions is NULL, error EC_ST_BAD_DATA is returned If pcDocInfo is NULL, error EC_ST_BAD_BUFFER is returned If the size of returned data is larger than the value specified in pdwDocInfoSize, error EC_ST_NOT_ENOUGH_MEMORY is returned Error results from bad connection with device can be one of the following:...
  • Page 24: Mtecsdk_Queryinfo

    ExpressCard 1000 Programming Reference MTECSDK_QueryInfo MTECSDK_QueryInfo function inquires data of a given section name from the given device name. ULONG MTECSDK_QueryInf ( char *pcDevName, char *pcSection, char *pcSectionData, DWORD *pdwLength Parameters pcDevName Pointer to null terminated string containing device name pcSection Pointer to null terminated string containing the section name.
  • Page 25: Remarks

    Section 3 – API DLL Remarks If the function succeeds EC_ST_OK is returned. If the device fails to respond, EC_ST_DEVICE_NOT_RESPONDING is returned. If the memory allocated for pcSectionData buffer that is not big enough to store the data of the inquiry section, EC_ST_NOT_ENOUGH_MEMORY is returned.
  • Page 26: Mtecsdk_Setvalue

    ExpressCard 1000 Programming Reference MTECSDK_SetValue MTECSDK_SetValue function adds a key/value pair to the given device settings specified in pcOptions buffer and in a given section specified in pcSection buffer. ULONG MTECSDK_SetValue ( char *pcOptions, char *pcSection, char *pcKey, char *pcValue,...
  • Page 27: Example

    Section 3 – API DLL Example char Settings [4096]; DWORD SettingsBufferSize; // Initialize Settings // Initialize the Settings variable first SettingsBufferSize =4096; // Set a value of “4” to the key “Number” in section “ImageOptions”and store this new key/value pair in the buffer” Settings” dwStatus=MTECSDK_SetValue(Settings, "ImageOptions","Number","4", &SettingsBufferSize);...
  • Page 28: Remarks

    ExpressCard 1000 Programming Reference Remarks MTECSDK_GetValue finds the key in the pcDocInfo buffer then returns its value in the pcValue. If MTECSDK_GetValue succeeds it returns EC_ST_OK. If pdwLength is less than the size of the returned value then EC_ST_NOT_ENOUGH_MEMORY is returned and the required size for the pcValue buffer is returned in the pdwLength.
  • Page 29: Mtecsdk_Setattribute

    Section 3 – API DLL MTECSDK_SetAttribute MTECSDK_SetAttribute function sets the attribute of a key/value pair to the given settings specified in pcOptions buffer and in a given section specified in pcSection buffer. ULONG MTECSDK_SetAttribute ( char *pcOptions, char *pcSection, char *pcKey, char *pcValue,...
  • Page 30: Mtecsdk_Getattribute

    ExpressCard 1000 Programming Reference MTECSDK_GetAttribute MTECSDK_GetAttribute function retrieves a key/value pair that was previously stored in the pcDocInfo parameter using MTECSDK_SetAttribute function ULONG MTECSDK_GetAttribute ( char *pcDocInfo, char *pcSection, char *pcKey, char *pcValue, DWORD *pdwLength Parameters pcDocInfo Buffer pointer containing all the key/value pairs.
  • Page 31: Example

    Section 3 – API DLL Example char Settings [4096]; char DocInfo [4096]; char device[4096] =""; DWORD SettingsBufferSize; DWORD DocInfoSize; char cValue [1024]; DWORD valueSize; DWORD dwStatus; // Initialize Settings DocInfoSize = 4096; // Use function MTECSDK_GetDevice to get device name for variable “device” // Call MTECSDK_ProcessDoc function to process a document.
  • Page 32: Mtecsdk_Logenable

    ExpressCard 1000 Programming Reference MTECSDK_LogEnable MTECSDK_LogEnable enable or disable the logging. If there is a desire to get a log file of all messages and errors, a valid log file handle must be set with function MTECSDK_SetLogFileHandle and also a TRUE value is set for parameter of function MTECSDK_LogEnable.
  • Page 33: Mtecsdk_Setlogfilehandle

    Section 3 – API DLL MTECSDK_SetLogFileHandle MTECSDK_SetLogFileHandle specifies a handle for a log file. All messages and errors created by all API functions will be logged in the log file that has this specified handle. By default, there is no log file VOID MTECSDK_SetLogFileHandle ( HANDLE hFileHandle...

Table of Contents