ACS Audio Jack iOS Library
1.0.0
|
The ACRAudioJackReader
class represents ACS audio jack readers.
More...
#import <ACRAudioJackReader.h>
Instance Methods | |
(id) | - initWithMute: |
Returns an initialized ACRAudioJackReader object with mute option. More... | |
(id) | - delegate |
Gets the delegate. More... | |
(void) | - setDelegate: |
Sets the delegate. More... | |
(void) | - reset |
Resets the reader. More... | |
(void) | - resetWithCompletion: |
Resets the reader using completion handler. More... | |
(BOOL) | - sleep |
Sets the reader to sleep. More... | |
(BOOL) | - getFirmwareVersion |
Gets the firmware version. More... | |
(BOOL) | - getStatus |
Gets the status. More... | |
(BOOL) | - setSleepTimeout: |
Sets the sleep timeout. More... | |
(void) | - authenticateWithMasterKey:length: |
Authenticates the reader. More... | |
(void) | - authenticateWithMasterKey:length:completion: |
Authenticates the reader using completion handler. More... | |
(BOOL) | - getCustomId |
Gets the custom ID from the reader. More... | |
(BOOL) | - setCustomId:length: |
Sets the custom ID to the reader. More... | |
(BOOL) | - getDeviceId |
Gets the device ID from the reader. More... | |
(BOOL) | - setMasterKey:length: |
Sets the master key to the reader. More... | |
(BOOL) | - setAesKey:length: |
Sets the AES key to the reader. More... | |
(BOOL) | - getDukptOption |
Gets the DUKPT option from the reader. More... | |
(BOOL) | - setDukptOption: |
Sets the DUKPT option to the reader. More... | |
(BOOL) | - initializeDukptWithIksn:iksnLength:ipek:ipekLength: |
Initializes DUKPT to the reader. More... | |
(BOOL) | - getTrackDataOption |
Gets the track data option from the reader. More... | |
(BOOL) | - setTrackDataOption: |
Sets the track data option to the reader. More... | |
(BOOL) | - piccPowerOnWithTimeout:cardType: |
Powers on the PICC. More... | |
(BOOL) | - piccTransmitWithTimeout:commandApdu:length: |
Transmits the command APDU to the PICC. More... | |
(BOOL) | - piccPowerOff |
Powers off the PICC. More... | |
(BOOL) | - setPiccRfConfig:length: |
Sets the PICC RF configuration. More... | |
(NSData *) | - powerCardWithAction:slotNum:timeout:error: |
Performs the power action on the card. More... | |
(ACRCardProtocol) | - setProtocol:slotNum:timeout:error: |
Sets the protocol. More... | |
(NSData *) | - transmitApdu:slotNum:timeout:error: |
Transmits the APDU. More... | |
(NSData *) | - transmitApdu:length:slotNum:timeout:error: |
Transmits the APDU. More... | |
(NSData *) | - transmitControlCommand:controlCode:slotNum:timeout:error: |
Transmits the control command. More... | |
(NSData *) | - transmitControlCommand:length:controlCode:slotNum:timeout:error: |
Transmits the control command. More... | |
(void) | - updateCardStateWithSlotNumber:timeout:error: |
Updates the card state. More... | |
(NSData *) | - getAtrWithSlotNumber: |
Gets the ATR string. More... | |
(ACRCardState) | - getCardStateWithSlotNumber: |
Gets the card state. More... | |
(ACRCardProtocol) | - getProtocolWithSlotNumber: |
Gets the active protocol. More... | |
(BOOL) | - sendCommand:length: |
Sends a command to the reader. More... | |
(NSData *) | - createFrame:length: |
Creates a frame. More... | |
(BOOL) | - sendFrame: |
Sends a frame to the reader. More... | |
(BOOL) | - verifyData:length: |
Verifies the data using CRC16 checksum. More... | |
Properties | |
BOOL | mute |
YES to mute the audio output, otherwise NO . More... | |
The ACRAudioJackReader
class represents ACS audio jack readers.
- (void) authenticateWithMasterKey: | (const uint8_t *) | masterKey | |
length: | (NSUInteger) | length | |
Authenticates the reader.
masterKey | the master key. |
length | the master key length must be 16 bytes. |
- (void) authenticateWithMasterKey: | (const uint8_t *) | masterKey | |
length: | (NSUInteger) | length | |
completion: | (void(^)(NSInteger)) | completion | |
Authenticates the reader using completion handler.
masterKey | the master key. |
length | the master key length must be 16 bytes. |
completion | the block object to be executed when the authentication ends. The block has no return value and takes a single NSInteger argument for an error code. |
- (NSData *) createFrame: | (const void *) | buffer | |
length: | (NSUInteger) | length | |
Creates a frame.
buffer | the buffer. |
length | the buffer length. |
- (id) delegate |
Gets the delegate.
- (NSData *) getAtrWithSlotNumber: | (NSUInteger) | slotNum |
Gets the ATR string.
slotNum | the slot number. |
- (ACRCardState) getCardStateWithSlotNumber: | (NSUInteger) | slotNum |
- (BOOL) getCustomId |
Gets the custom ID from the reader.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) getDeviceId |
Gets the device ID from the reader.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) getDukptOption |
Gets the DUKPT option from the reader.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) getFirmwareVersion |
Gets the firmware version.
YES
if the request is queued successfully, otherwise NO
. - (ACRCardProtocol) getProtocolWithSlotNumber: | (NSUInteger) | slotNum |
Gets the active protocol.
slotNum | the slot number. |
- (BOOL) getStatus |
Gets the status.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) getTrackDataOption |
Gets the track data option from the reader.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) initializeDukptWithIksn: | (const uint8_t *) | iksn | |
iksnLength: | (NSUInteger) | iksnLength | |
ipek: | (const uint8_t *) | ipek | |
ipekLength: | (NSUInteger) | ipekLength | |
Initializes DUKPT to the reader.
In order to proceed this operation, your reader must be authenticated.
iksn | the initial key serial number (IKSN). |
iksnLength | the IKSN length must be 10 bytes. |
ipek | the initial PIN encryption key (IPEK). |
ipekLength | the IPEK length must be 16 bytes. |
YES
if the request is queued successfully, otherwise NO
. - (id) initWithMute: | (BOOL) | mute |
Returns an initialized ACRAudioJackReader
object with mute option.
mute | YES to mute the audio output, otherwise NO . |
ACRAudioJackReader
object. - (BOOL) piccPowerOff |
Powers off the PICC.
YES
if the request is queued successfully, otherwise NO
. - (BOOL) piccPowerOnWithTimeout: | (NSUInteger) | timeout | |
cardType: | (NSUInteger) | cardType | |
Powers on the PICC.
timeout | the timeout value in seconds. |
cardType | the card type. See ACRPiccCardType. It can be combined with OR operation. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) piccTransmitWithTimeout: | (NSUInteger) | timeout | |
commandApdu: | (const uint8_t *) | commandApdu | |
length: | (NSUInteger) | length | |
Transmits the command APDU to the PICC.
timeout | the timeout value in seconds. |
commandApdu | the command APDU. |
length | the command APDU length. |
YES
if the request is queued successfully, otherwise NO
. - (NSData *) powerCardWithAction: | (ACRCardPowerAction) | action | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Performs the power action on the card.
action | the action to be performed on the card. See ACRCardPowerAction. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
nil
. - (void) reset |
Resets the reader.
- (void) resetWithCompletion: | (void(^)(void)) | completion |
Resets the reader using completion handler.
completion | the block object to be executed when the reset ends. |
- (BOOL) sendCommand: | (const void *) | buffer | |
length: | (NSUInteger) | length | |
Sends a command to the reader.
buffer | the buffer. |
length | the buffer length. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) sendFrame: | (NSData *) | frameData |
Sends a frame to the reader.
frameData | the frame data. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) setAesKey: | (const uint8_t *) | aesKey | |
length: | (NSUInteger) | length | |
Sets the AES key to the reader.
In order to proceed this operation, your reader must be authenticated.
aesKey | the AES key. |
length | the AES key length must be 16 bytes. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) setCustomId: | (const uint8_t *) | customId | |
length: | (NSUInteger) | length | |
Sets the custom ID to the reader.
In order to proceed this operation, your reader must be authenticated.
customId | the custom ID. |
length | the custom ID length must be 10 bytes. |
YES
if the request is queued successfully, otherwise NO
. - (void) setDelegate: | (id) | newDelegate |
Sets the delegate.
newDelegate | the delegate. |
- (BOOL) setDukptOption: | (BOOL) | enabled |
Sets the DUKPT option to the reader.
In order to proceed this operation, your reader must be authenticated.
enabled | set to true to enable DUKPT. Otherwise, set to false. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) setMasterKey: | (const uint8_t *) | masterKey | |
length: | (NSUInteger) | length | |
Sets the master key to the reader.
In order to proceed this operation, your reader must be authenticated.
masterKey | the master key. |
length | the master key length must be 16 bytes. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) setPiccRfConfig: | (const uint8_t *) | rfConfig | |
length: | (NSUInteger) | length | |
Sets the PICC RF configuration.
rfConfig | the RF configuration. The length must be 19 bytes. |
length | the RF configuration length. |
YES
if the request is queued successfully, otherwise NO
. - (ACRCardProtocol) setProtocol: | (ACRCardProtocol) | preferredProtocols | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Sets the protocol.
preferredProtocols | the preferred protocols. It can be combined with OR operation. For example, ACRProtocolT0 | ACRProtocolT1. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
- (BOOL) setSleepTimeout: | (NSUInteger) | timeout |
Sets the sleep timeout.
timeout | the timeout value in seconds. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) setTrackDataOption: | (ACRTrackDataOption) | option |
Sets the track data option to the reader.
In order to proceed this operation, your reader must be authenticated.
option | the track data option. See ACRTrackDataOptionEncryptedTrack1, ACRTrackDataOptionEncryptedTrack2, ACRTrackDataOptionMaskedTrack1 and ACRTrackDataOptionMaskedTrack2. It can be combined with OR operation. |
YES
if the request is queued successfully, otherwise NO
. - (BOOL) sleep |
Sets the reader to sleep.
YES
if the request is queued successfully, otherwise NO
. - (NSData *) transmitApdu: | (const uint8_t *) | command | |
length: | (NSUInteger) | length | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSUInteger) | timeout | |
error: | (NSError **) | errorPtr | |
Transmits the APDU.
command | the command APDU. |
length | the command APDU length. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
nil
. - (NSData *) transmitApdu: | (NSData *) | command | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Transmits the APDU.
command | the command APDU. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
nil
. - (NSData *) transmitControlCommand: | (NSData *) | command | |
controlCode: | (NSUInteger) | controlCode | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Transmits the control command.
command | the control command. |
controlCode | the control code. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
nil
. - (NSData *) transmitControlCommand: | (const uint8_t *) | command | |
length: | (NSUInteger) | length | |
controlCode: | (NSUInteger) | controlCode | |
slotNum: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Transmits the control command.
command | the control command. |
length | the control command length. |
controlCode | the control code. |
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
nil
. - (void) updateCardStateWithSlotNumber: | (NSUInteger) | slotNum | |
timeout: | (NSTimeInterval) | timeout | |
error: | (NSError **) | errorPtr | |
Updates the card state.
slotNum | the slot number. |
timeout | the maximum time to wait in seconds. |
errorPtr | if there is an error, upon return contains an NSError object that describes the problem. |
- (BOOL) verifyData: | (const void *) | buffer | |
length: | (NSUInteger) | length | |
Verifies the data using CRC16 checksum.
The checksum is located at the last 2 bytes of data.
buffer | the buffer. |
length | the buffer length. |
YES
if the checksum is correct, otherwise NO
.
|
readwriteatomic |
YES
to mute the audio output, otherwise NO
.