Owner's manual
Table Of Contents
- Section 1. MagTekSCRA Class
- Methods
- openDevice:
- closeDevice:
- isDeviceConnected
- clearBuffers
- getMaskedTracks
- getTrack1
- getTrack2
- getTrack3
- getTrack1Masked
- getTrack2Masked
- getTrack3Masked
- getMagnePrint
- getMagnePrintStatus
- getDeviceSerial
- getSessionID
- getKSN
- getTagValue
- getMagTekDeviceSerial
- getFirmware
- getDeviceName
- getDeviceCaps
- getDeviceStatus
- getTLVVersion
- getDevicePartNumber
- sendCommandToDevice
- getCapMSR
- getCapTracks
- getCapMagStripeEncryption
- setDeviceProtocolString
- listenForEvents
- getDeviceType
- getCardPANLength
- getResponseData
- getCardName
- getCardIIN
- getCardLast4
- getCardExpDate
- getCardServiceCode
- getCardStatus
- getTrackDecodeStatus
- getResponseType
- setDeviceType
- isDeviceOpened
- getBatteryLevel
- getSDKVersion
- getOperationStatus
- setConfigurationParams
- Notification
- Enum
- Methods
- Section 2. Commands
- Section 3. Code Examples
23
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.mtSCRALib closeDevice];
Get Tracks Data From Reader:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(trackDataReady:) name:@"trackDataReadyNotification"
object:nil];
- (void)trackDataReady:(NSNotification *)notification
{
NSNumber *status = [[notification userInfo]
valueForKey:@"status"];
[self performSelectorOnMainThread:@selector(onDataEvent:)
withObject:status waitUntilDone:YES];
}
- (void)onDataEvent:(id)status
{
//[self clearLabels];
switch ([status intValue]) {
case TRANS_STATUS_OK:
NSLog(@"TRANS_STATUS_OK");
break;
case TRANS_STATUS_ERROR: