BLUETOOTH SWIPE READER JAVA APPLET PROGRAMMING REFERENCE MANUAL PART NUMBER 99875530-1 DECEMBER 2010 Confidential This document contains the proprietary information of MagTek. Its receipt or possession does not convey any rights to reproduce or disclose its contents or to manufacture, use or sell anything it may describe. Reproduction, disclosure or use without specific written authorization of MagTek is strictly forbidden.
Copyright© 2001-2011 MagTek®, Inc. Printed in the United States of America 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. Microsoft © is a trademark of Microsoft, Inc. MagTek is a registered trademark of MagTek, Inc. REVISIONS Rev Number 1.
SOFTWARE LICENSE AGREEMENT IMPORTANT: YOU SHOULD CAREFULLY READ ALL THE TERMS, CONDITIONS AND RESTRICTIONS OF THIS LICENSE AGREEMENT BEFORE INSTALLING THE SOFTWARE PACKAGE. YOUR INSTALLATION OF THE SOFTWARE PACKAGE PRESUMES YOUR ACCEPTANCE OF THE TERMS, CONDITIONS, AND RESTRICTIONS CONTAINED IN THIS AGREEMENT. IF YOU DO NOT AGREE WITH THESE TERMS, CONDITIONS, AND RESTRICTIONS, PROMPTLY RETURN THE SOFTWARE PACKAGE AND ASSOCIATED DOCUMENTATION TO THE ABOVE ADDRESS, ATTENTION: CUSTOMER SUPPORT.
iv
TABLE OF CONTENTS SECTION 1. FEATURES AND SPECIFICATIONS ........................................................ 1 INTRODUCTION ...................................................................................................................................... 1 SECTION 2. METHODS ................................................................................................. 3 AUTOCONNECT METHOD............................................................................................................
SECTION 3. EVENTS ...................................................................................................
SECTION 1. FEATURES AND SPECIFICATIONS INTRODUCTION This document describes the properties, methods and events provided by the Java Applet component to communicate with MagTek Bluetooth Readers. For additional information, refer to the reader the Bluetooth Reader specific manual.
Bluetooth Java Applet Reference Manual 2
SECTION 2. METHODS In general, most methods return an integer of 0 to indicate a successful call. Otherwise, a nonzero integer value is returned to inform that there is an error, and the error message can be retrieved with the “GetLastErrMessage()” method. AUTOCONNECT METHOD Returns an integer value.
Bluetooth Java Applet Reference Manual CARDDATAMASKED METHOD Returns a string value indicating the masked card data. Syntax String CardDataMasked() CARDENCODETYPE METHOD Returns a string value indicating the card encode type from the reader. Syntax String CardEncodeType() Remarks Always returning an empty string at this time. (RFU) CLOSEPORT METHOD Returns an integer value indicating the status of the ClosePort method.
Methods DEVICEPORT METHOD Sets the serial port number. Syntax void DevicePort(int devPortNumber) The DevicePort method syntax has this part: Part Data Type devPortNumber int Description Serial device port number DEVICESERIALNUMBER METHOD Returns a string value indicating the device serial number from the reader. Syntax String DeviceSerialNumber() DEVICESETTINGS METHOD Returns an integer value indicating the status of the setting.
Bluetooth Java Applet Reference Manual DUKPTKSN METHOD Returns a string value indicating the key serial number from the reader. Syntax String DUKPTKSN() FINDELEMENT METHOD Returns particular information after parsing out specific card data. Syntax String FindElement(int whatTrack, String strStart, int offset, String strEnd) Remarks Returns particular information after parsing out specific card data based on parameters selected by the user.
Methods Example String var = FindElementMasked(2, ”;”, 0, “=”); GETCURRENTPORTNAME METHOD Return the name of the port that’s opened. Syntax String GetCurrentPortName() Remarks Returns the port name, e.g. COM7 GETEXPIRATIONMONTH METHOD Returns the Expiration Month as a string. Syntax String GetExpirationMonth() GETEXPIRATIONYEAR METHOD Returns the Expiration Year as a string. Syntax String GetExpirationYear () GETLASTERRMESSAGE METHOD Returns the last error message that the applet has detected.
Bluetooth Java Applet Reference Manual GETFNAME METHOD Returns the First Name of the track data. Syntax String GetFName() GETFNAMEMASKED METHOD Returns the First Name from the masked track data. Syntax String GetFNameMasked() GETLNAME METHOD Returns the Last Name of the track data. Syntax String GetLName() GETLNAMEMASKED METHOD Returns the Last Name from the masked track data.
Methods GETTRACKMASKED METHOD Returns the masked card data if supported by the reader from a specific track (1,2,3) Syntax String GetTrackMasked(int iTk) The GetTrackMasked method syntax has these parts: Part Data Type iTk int Description Track 1,2,3 GETPAN METHOD Returns PAN. Syntax String GetPAN() GETPORTNAMES METHOD Returns an array of port names that are available for connections.
Bluetooth Java Applet Reference Manual GETREADERTYPE METHOD Gets the current setting of the reader interface type. Syntax int GetReaderType() Remarks 1 = Bluetooth; 0 = other reader GETUPDATESPDRIVERSTATUS METHOD Returns an integer value indicating if the status of the serial port driver installation. Syntax int GetUpdateSPDriverStatus() Remarks Retrieves the status of the serial port driver installed. If the returning value is zero (0) then the status is OK, otherwise non-zero for error.
Methods MPRINTSTATUS METHOD Returns an integer value indicating the status of MagnePrint data. Syntax int MPrintStatust() OPENPORT METHOD Returns an integer value indicating the status of the OpenPort method. This OpenPort(port) function provides a short-cut to connect to a Magtek Bluetooth card reader using default settings: baud rate of 9600, parity of ‘N’, data bits of 8, and stop bits of 1.
Bluetooth Java Applet Reference Manual The OpenPort method has these parts: Part sPortname Data Type String sBaudRate sDataBits sStopBits sParityType String String String String Description The port name is a combination of the word “COM” and the port number, e.g. If the Bluetooth is connected to port 7, then the portName is COM7. Baud Rate Data Bits Stop Bits Parity Example int stat = OpenPort(“COM7”, ”9600”, “8”, “1”, “N” ); This returns a zero (0) if the port opened with the parameters.
Methods Syntax String ReaderID() RXTIMEOUT METHOD Sets RX timeout. (RFU) Syntax void RXTimeout(int rxtimeout) The RXTimeout method has this part: Part Data Type Description Rxtimeout int RX Timeout SENDDATA METHOD Returns a string value from the reader. Syntax String SendData(String sRequest) Remarks Send specific command to the Bluetooth reader. The length of the sRequest is automatically calculated by the component.
Bluetooth Java Applet Reference Manual Remarks Send specific command to the Bluetooth reader. The length of the sRequest is not automatically calculated by the component. If the command fails or encounters an error, the error will be return and the user needs to parse it. The SendDataWlen method has this part: Part Data Type Description sRequest String Command Example String response = SendDataWlen(“000110”); The response will be a hexadecimal string returned from the reader.
Methods Syntax int SendDataSyncWlen(String sRequest, byte[] response) Remarks Send specific command to the Bluetooth reader. The result is sent through the response parameter and the result can also be retrieved with SwipeCommandOutput() method. If SendDataSyncWlen returns a zero (0) the command executes successfully, otherwise a non-zero for error.
Bluetooth Java Applet Reference Manual SETREADERTYPE METHOD Sets the type of the reader. Syntax void SetReaderType(int iRdrInterface) The SetReaderType method has this part: Part Data Type iRdrInterface int Description 1 = Bluetooth; 0 = Generic RS232 reader SWIPECOMMANDOUTPUT METHOD Returns the result as string of a previously sent command. Syntax String SwipeCommandOutput() Remarks Returns the result as a string based on the input command.
Methods TRACK1LENGTHMASKED MEDTHOD Returns an integer value indicating the length of masked track1 data. Syntax int Track1LengthMasked() TRACK2LENGTHMASKED MEDTHOD Returns an integer value indicating the length of masked track2 data. Syntax int Track2LengthMasked() TRACK3LENGTHMASKED MEDTHOD Returns an integer value indicating the length of masked track3 data.
Bluetooth Java Applet Reference Manual 18
SECTION 3. EVENTS 1) On a card data change event: In the event of card data change, the applet will return the card-swipe data by calling the Java script provided in the para name of RunJSOnCardDataChange. The Java script to be called must have one parameter to receive the card-swipe data. For example, the applet will return the card-swipe data by calling the “SetCardData” Java script in the following example.
Bluetooth Java Applet Reference Manual 20