Audio Reader PROGRAMMING REFERENCE MANUAL PART NUMBER 99875582-1 SEPTEMBER 2012 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-2012 ® 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. MagTek is a registered trademark of MagTek, Inc. REVISIONS Rev Number 1.01 1.02 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.
Table of Contents Section 1. MagTekSCRA Class ......................................................................................... 1 Methods........................................................................................................................... 3 openDevice: ................................................................................................................ 3 closeDevice: ....................................................................................................
getResponseType ...................................................................................................... 15 setDeviceType........................................................................................................... 15 isDeviceOpened ........................................................................................................ 16 getBatteryLevel ......................................................................................................... 16 getSDKVersion ....
vi
SECTION 1. MagTekSCRA CLASS Classes MagTekSCRA Description This class allows you to perform reader functions.
Notifications: trackDataReadyNotification devConnectionNotification getSDKVersion getOperationStatus Receieves notification when track data is available on reader Receieves notification when reader’s connection status is changed Retrieves SDK version Retrieves operation status Enum: MTSCRADeviceType MTSCRATransactionStatus MTSCRATransactionData MAGTEKAUDIOREADER TRANS_STATUS_OK TRANS_STATUS_START TRANS_STATUS_ERROR TLV_OPSTS TLV_CARDSTS TLV_TRACKSTS TLV_CARDNAME TLV_CARDIIN TLV_CARDLAST4 TLV_CARDEXPDATE
Methods openDevice: This function opens the reader. - (BOOL) openDevice Parameters Return Value YES if the device is opened successfully. Otherwise, return NO. closeDevice: This function close the reader. - (BOOL) closeDevice Parameters Return Value YES if the device is closed successfully. Otherwise, return NO. isDeviceConnected This function retrieves the connection status of the reader. - (BOOL) isDeviceConnected Parameters Return Value YES if the device is connected. Otherwise, return NO.
getMaskedTracks Retrieves existing stored Masked data, only supported for iDynamo, it will return a empty string in audio reader. If decodable track data exists for a given track, it is located in the Masked Track Data field that corresponds to the track number. The length of each Masked Track Data field is fixed at 112 bytes, but the length of valid data in each field is determined by the Masked Track Data Length field that corresponds to the track number.
getTrack2 Retrieve Encrypted Track2 if any. This field contains the encrypted track data for track 2. - (NSString *) getTrack2 Parameters Return Value Return stored encrypted track2 data string. getTrack3 Retrieve Encrypted Track3 if any. This field contains the encrypted track data for track 3. - (NSString *) getTrack3 Parameters Return Value Return stored encrypted track3 data string.
getTrack1Masked Retrieve Masked Track1 if any - (NSString *) getTrack1 Parameters Return Value Return stored masked track1 data string. For an ISO/ABA card, the PAN is masked as follows: • The specified number of initial characters is sent unmasked. The specified number of trailing characters is sent unmasked.
For an AAMVA card, the DL/ID# is masked as follows: • The specified number of initial characters are sent unmasked. The specified number of trailing characters are sent unmasked. If Mod 10 correction is specified, all but one of the intermediate characters of the DL/ID#PAN are set to zero; one of them will be set such that last digit of the DL/ID# calculates an accurate Mod 10 check of the rest of the DL/ID# as transmitted.
getMagnePrintStatus Supported on uDynamo only - (NSString *) getMagnePrintStatus Parameters Return Value Empty String. This Binary field represents 32 bits of MagnePrint status information. Each character represents 4 bits (hexadecimal notation).
be retrieved and set with the device serial number property explained in the property section of this document. This field is stored in non-volatile memory, so it will persist when the unit is power cycled. - (NSString *) getDeviceSerial Parameters Return Value Return stored device serial number. getSessionID Not Supported on Audio Reader. This 8-byte Binary field contains the encrypted version of the current Session ID. Its primary purpose is to prevent replays.
getTagValue Retrieve individual tag value, only supported in audio reader - (NSString *) getTagValue: (UInt32)tag Parameters tag A MTSCRATransactionData Enum type. Return Value Return tag value. getMagTekDeviceSerial Retrieve Device Serial Number created by MagTek - (NSString *) getMagTekDeviceSerial Parameters Return Value Return stored key serial number created by MagTek. getFirmware Retrieve firmware version number. - (NSString *) getFirmware Parameters Return Value Return firmware version.
getDeviceCaps Get device capabilities. For future use. - (NSString *) getDeviceCaps Parameters Return Value Return device capabilities. getDeviceStatus Get device status. For future use. - (NSString *) getDeviceStatus Parameters Return Value Return device status. getTLVVersion Get TLV Version of firmware. - (NSString *) getTLVVersion Parameters Return Value Return TLV version of firmware as a Two-byte hex string. getDevicePartNumber Not Supported on Audio Reader.
sendCommandToDevice Send command to device. - (Void *) sendCommandToDevice: (NSString *)pData Parameters Command string. Return Value Send command to device. Please refer to Section 2 for command list. getCapMSR Retrieve MSR Capability. Returned when Discovery Command is sent. - (NSString *) getCapMSR Parameters Return Value Return MSR Capability 0 = No MSR, 1 = MSR getCapTracks Retrieve Tracks Capability. Returned when Discovery Command is sent.
setDeviceProtocolString Sets the protocol String for iDynamo - (void) setDeviceProtocolString: (NSString *)pData Parameters Protocol String listenForEvents Setup the events to listen for - (void) setDeviceProtocolString: (UInt32 *)event Parameters Event getDeviceType Retrieves the Device Type. For future use.
getCardName Retrieves the Name in the Card - (NSString *) getCardName Parameters Return Value Card Name getCardIIN Retrieves the IIN in the Card - (NSString *) getCardIIN Parameters Return Value IIN getCardLast4 Retrieves the Last 4 of the PAN - (NSString *) getCardLast4 Parameters Return Value Last 4 of the PAN getCardExpDate Retrieves the Expiration Date - (NSString *) getCardExpDate Parameters Return Value Expiration Date getCardServiceCode Retrieves the Service Code - (NSString *) getCardServiceCode
getCardStatus Retrieves the Card Status - (NSString *) getCardStatus Parameters Return Value Card Status getTrackDecodeStatus Retrieves the Track Decode Status. This is a one-byte value, which indicates the status of decoding track 1. Bit position zero indicates if there was an error decoding track 1 if the bit is set to one. If it is zero, then no error occurred. If a track has data on it that is not noise, and it is not decodable, then a decode error is indicated.
MTSCRADeviceType.
getOperationStatus Retrieves the operation status. - (NSString *) getOperationStatus Parameters Return Value 2-byte bit string in hex.
Notification trackDataReadyNotification Notification received when tracks data is available on reader. devConnectionNotification Notification received when the connection status of the reader is changed.
Enum MTSCRADeviceType MAGTEKAUDIOREADER is used to open/close audio reader. MTSCRATransactionStatus TRANS_STATUS_OK is triggered when transaction succeed. TRANS_STATUS_START is triggered when reader starts sending data. TRANS_STATUS_ERROR is triggered when reader fails sending data.
Encrypted track 2 TLV_ENCTK3 Encrypted track 3 TLV_DEVSN Device serial number TLV_DEVSNMAGTEK Device serial number created by Magek TLV_DEVFW Device firmware version TLV_DEVNAME Device model name TLV_DEVCAPS Device capabilities TLV_DEVSTATUS Device status TLV_TLVVERSION Firmware TLV version TLV_DEVPARTNUMBER Device part number TLV_KSN KSN TLV_CMAC CMAC 20
SECTION 2. COMMANDS Discovery Send discovery command to device. - (Void *) sendCommandToDevice: (NSString *)command Parameters Command string: use “C10206C20503840900” as command string. Return Value Following device information can be retrieved. Device SN, internal Device serial number created by chip manufacturer. use getDeviceSerial method to retrieve data. Device SN, MagTek Device serial number created by MagTek. use getDeviceSerialMagTek method to retrieve data.
4 5 6 7 = = = = Supported Supported Supported Supported tracks: tracks: tracks: tracks: Track3. Track1, Track3. Track2, Track3. Track1, Track2, Track3. use getCapTracks method to retrieve data. Capability – MagStripe Encryption 0 = No Encryption, 1 = TripDES DUKPT use getCapMagStripeEncryption method to retrieve data.
SECTION 3. CODE EXAMPLES Open Device: self.mtSCRALib = [[MTSCRA alloc] init]; [self.mtSCRALib listenForEvents:(TRANS_EVENT_OK|TRANS_EVENT_START|TRANS_EVENT_ERROR)]; //iDynamo [self.mtSCRALib setDeviceType:(MAGTEKIDYNAMO)]; [self.mtSCRALib setDeviceProtocolString:(“com.magtek.idynamo”)]; [self.mtSCRALib setDeviceType:(MAGTEKIDYNAMO)]; //Audio //[self.mtSCRALib setDeviceType:(MAGTEKAUDIOREADER)]; [self.mtSCRALib openDevice]; Close Device: [self.
NSLog(@"TRANS_STATUS_ERROR"); break; } default: break; } Get Connection Status Of Reader: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(devConnStatusChange) name:@"devConnectionNotification" object:nil]; - (void)devConnStatusChange { BOOL isDeviceConnected = [self.mtSCRALib isDeviceConnected]; if (isDeviceConnected) { self.deviceStatus.text = @"Device Connected"; } else { self.deviceStatus.