ACS Audio Jack iOS Library  1.0.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties
ACRAudioJackReader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Advanced Card Systems Ltd. All Rights Reserved.
3  *
4  * This software is the confidential and proprietary information of Advanced
5  * Card Systems Ltd. ("Confidential Information"). You shall not disclose such
6  * Confidential Information and shall use it only in accordance with the terms
7  * of the license agreement you entered into with ACS.
8  */
9 
10 #import <Foundation/Foundation.h>
11 
16 
20 };
21 
26 
32 };
33 
37 typedef enum {
38 
43 
47 enum {
48 
52  ACRProtocolUndefined = 0x00000000,
53 
57  ACRProtocolT0 = 0x00000001,
58 
62  ACRProtocolT1 = 0x00000002,
63 
67  ACRProtocolRaw = 0x00010000,
68 
73 
77  ACRProtocolDefault = 0x80000000,
78 
83  ACRProtocolOptimal = 0x00000000
84 };
85 
89 typedef NSUInteger ACRCardProtocol;
90 
94 typedef enum {
95 
100 
105 
111 
117 
123 
128 
134 } ACRCardState;
135 
139 enum {
140 
145 
150 };
151 
153 enum {
154 
157 
160 
163 
166 };
167 
169 typedef NSUInteger ACRTrackDataOption;
170 
171 @class ACRResult;
172 @class ACRStatus;
173 @class ACRTrackData;
174 
180 @interface ACRAudioJackReader : NSObject
181 
185 @property BOOL mute;
186 
194 - (id)initWithMute:(BOOL)mute;
195 
199 - (id)delegate;
200 
205 - (void)setDelegate:(id)newDelegate;
206 
210 - (void)reset;
211 
216 - (void)resetWithCompletion:(void (^)(void))completion;
217 
223 - (BOOL)sleep;
224 
230 - (BOOL)getFirmwareVersion;
231 
237 - (BOOL)getStatus;
238 
245 - (BOOL)setSleepTimeout:(NSUInteger)timeout;
246 
252 - (void)authenticateWithMasterKey:(const uint8_t *)masterKey length:(NSUInteger)length;
253 
262 - (void)authenticateWithMasterKey:(const uint8_t *)masterKey length:(NSUInteger)length completion:(void (^)(NSInteger))completion;
263 
269 - (BOOL)getCustomId;
270 
281 - (BOOL)setCustomId:(const uint8_t *)customId length:(NSUInteger)length;
282 
288 - (BOOL)getDeviceId;
289 
300 - (BOOL)setMasterKey:(const uint8_t *)masterKey length:(NSUInteger)length;
301 
312 - (BOOL)setAesKey:(const uint8_t *)aesKey length:(NSUInteger)length;
313 
319 - (BOOL)getDukptOption;
320 
330 - (BOOL)setDukptOption:(BOOL)enabled;
331 
344 - (BOOL)initializeDukptWithIksn:(const uint8_t *)iksn iksnLength:(NSUInteger)iksnLength ipek:(const uint8_t *)ipek ipekLength:(NSUInteger)ipekLength;
345 
351 - (BOOL)getTrackDataOption;
352 
366 - (BOOL)setTrackDataOption:(ACRTrackDataOption)option;
367 
376 - (BOOL)piccPowerOnWithTimeout:(NSUInteger)timeout cardType:(NSUInteger)cardType;
377 
386 - (BOOL)piccTransmitWithTimeout:(NSUInteger)timeout commandApdu:(const uint8_t *)commandApdu length:(NSUInteger)length;
387 
393 - (BOOL)piccPowerOff;
394 
402 - (BOOL)setPiccRfConfig:(const uint8_t *)rfConfig length:(NSUInteger)length;
403 
415 - (NSData *)powerCardWithAction:(ACRCardPowerAction)action slotNum:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
416 
430 - (ACRCardProtocol)setProtocol:(ACRCardProtocol)preferredProtocols slotNum:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
431 
442 - (NSData *)transmitApdu:(NSData *)command slotNum:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
443 
455 - (NSData *)transmitApdu:(const uint8_t *)command length:(NSUInteger)length slotNum:(NSUInteger)slotNum timeout:(NSUInteger)timeout error:(NSError **)errorPtr;
456 
468 - (NSData *)transmitControlCommand:(NSData *)command controlCode:(NSUInteger)controlCode slotNum:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
469 
482 - (NSData *)transmitControlCommand:(const uint8_t *)command length:(NSUInteger)length controlCode:(NSUInteger)controlCode slotNum:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
483 
491 - (void)updateCardStateWithSlotNumber:(NSUInteger)slotNum timeout:(NSTimeInterval)timeout error:(NSError **)errorPtr;
492 
498 - (NSData *)getAtrWithSlotNumber:(NSUInteger)slotNum;
499 
505 - (ACRCardState)getCardStateWithSlotNumber:(NSUInteger)slotNum;
506 
512 - (ACRCardProtocol)getProtocolWithSlotNumber:(NSUInteger)slotNum;
513 
521 - (BOOL)sendCommand:(const void *)buffer length:(NSUInteger)length;
522 
529 - (NSData *)createFrame:(const void *)buffer length:(NSUInteger)length;
530 
537 - (BOOL)sendFrame:(NSData *)frameData;
538 
547 - (BOOL)verifyData:(const void *)buffer length:(NSUInteger)length;
548 
549 @end
550 
555 @protocol ACRAudioJackReaderDelegate <NSObject>
556 @optional
557 
562 - (void)readerDidReset:(ACRAudioJackReader *)reader;
563 
569 - (void)reader:(ACRAudioJackReader *)reader didNotifyResult:(ACRResult *)result;
570 
576 - (void)reader:(ACRAudioJackReader *)reader didSendFirmwareVersion:(NSString *)firmwareVersion;
577 
583 - (void)reader:(ACRAudioJackReader *)reader didSendStatus:(ACRStatus *)status;
584 
589 - (void)readerDidNotifyTrackData:(ACRAudioJackReader *)reader;
590 
596 - (void)reader:(ACRAudioJackReader *)reader didSendTrackData:(ACRTrackData *)trackData;
597 
604 - (void)reader:(ACRAudioJackReader *)reader didSendRawData:(const uint8_t *)rawData length:(NSUInteger)length;
605 
611 - (void)reader:(ACRAudioJackReader *)reader didAuthenticate:(NSInteger)errorCode;
612 
619 - (void)reader:(ACRAudioJackReader *)reader didSendCustomId:(const uint8_t *)customId length:(NSUInteger)length;
620 
627 - (void)reader:(ACRAudioJackReader *)reader didSendDeviceId:(const uint8_t *)deviceId length:(NSUInteger)length;
628 
634 - (void)reader:(ACRAudioJackReader *)reader didSendDukptOption:(BOOL)enabled;
635 
644 - (void)reader:(ACRAudioJackReader *)reader didSendTrackDataOption:(ACRTrackDataOption)option;
645 
652 - (void)reader:(ACRAudioJackReader *)reader didSendPiccAtr:(const uint8_t *)atr length:(NSUInteger)length;
653 
660 - (void)reader:(ACRAudioJackReader *)reader didSendPiccResponseApdu:(const uint8_t *)responseApdu length:(NSUInteger)length;
661 
662 @end
The ACRAudioJackReaderDelegate protocol defines the response sent to a delegate of ACRAudioJackReader...
Definition: ACRAudioJackReader.h:555
This is the mask of ISO defined transmission protocols.
Definition: ACRAudioJackReader.h:72
Success.
Definition: ACRAudioJackReader.h:17
T=1 is the active protocol.
Definition: ACRAudioJackReader.h:62
Cycle power and reset the card.
Definition: ACRAudioJackReader.h:40
ISO14443 Type B.
Definition: ACRAudioJackReader.h:28
The ACRAudioJackReader class represents ACS audio jack readers.
Definition: ACRAudioJackReader.h:180
Control code for sending APDU to the reader.
Definition: ACRAudioJackReader.h:149
Timeout.
Definition: ACRAudioJackReader.h:19
BOOL getDeviceId()
Gets the device ID from the reader.
ACRCardState
Card state.
Definition: ACRAudioJackReader.h:94
id delegate()
Gets the delegate.
BOOL sleep()
Sets the reader to sleep.
Enable the masked track 2 data.
Definition: ACRAudioJackReader.h:165
Enable the encrypted track 2 data.
Definition: ACRAudioJackReader.h:159
The library is unaware of the current state of the reader.
Definition: ACRAudioJackReader.h:99
BOOL piccPowerOff()
Powers off the PICC.
Use the default transmission parameters or card clock frequency.
Definition: ACRAudioJackReader.h:77
NSUInteger ACRCardProtocol
Card protocol.
Definition: ACRAudioJackReader.h:89
Raw is the active protocol.
Definition: ACRAudioJackReader.h:67
Enable the masked track 1 data.
Definition: ACRAudioJackReader.h:162
T=0 is the active protocol.
Definition: ACRAudioJackReader.h:57
FeliCa 424kbps.
Definition: ACRAudioJackReader.h:30
The ACRStatus class represents the status.
Definition: ACRStatus.h:17
Use optimal transmission parameters or card clock frequency.
Definition: ACRAudioJackReader.h:83
ACRAuthError
Authentication error.
Definition: ACRAudioJackReader.h:15
There is no card in the reader.
Definition: ACRAudioJackReader.h:104
BOOL getTrackDataOption()
Gets the track data option from the reader.
BOOL getDukptOption()
Gets the DUKPT option from the reader.
ACRPiccCardType
PICC card type.
Definition: ACRAudioJackReader.h:25
There is no active protocol.
Definition: ACRAudioJackReader.h:52
The card has been reset and specific communication protocols have been established.
Definition: ACRAudioJackReader.h:133
NSUInteger ACRTrackDataOption
Track data option.
Definition: ACRAudioJackReader.h:169
Failure.
Definition: ACRAudioJackReader.h:18
FeliCa 212kbps.
Definition: ACRAudioJackReader.h:29
Power is being provided to the card, but the library is unaware of the mode of the card...
Definition: ACRAudioJackReader.h:122
There is a card in the reader, but it has not been moved into position for use.
Definition: ACRAudioJackReader.h:110
BOOL getStatus()
Gets the status.
The ACRResult class represents the result.
Definition: ACRResult.h:35
ACRCardPowerAction
Card power action.
Definition: ACRAudioJackReader.h:37
Enable the encrypted track 1 data.
Definition: ACRAudioJackReader.h:156
BOOL getFirmwareVersion()
Gets the firmware version.
BOOL getCustomId()
Gets the custom ID from the reader.
Control code for sending escape command to the reader.
Definition: ACRAudioJackReader.h:144
BOOL mute
YES to mute the audio output, otherwise NO.
Definition: ACRAudioJackReader.h:185
ISO14443 Type A.
Definition: ACRAudioJackReader.h:27
Force a reset on the card.
Definition: ACRAudioJackReader.h:41
The ACRTrackData class represents the track data after swiping a card from the reader.
Definition: ACRTrackData.h:39
Power down the card.
Definition: ACRAudioJackReader.h:39
The card has been reset and is awaiting PTS negotiation.
Definition: ACRAudioJackReader.h:127
void reset()
Resets the reader.
Auto RATS.
Definition: ACRAudioJackReader.h:31
There is a card in the reader in position for use.
Definition: ACRAudioJackReader.h:116