ACS Bluetooth iOS/Mac OS X Library  1.0.0
 All Classes Files Functions Variables Typedefs Enumerator Properties
ABTBluetoothReader Class Reference

The ABTBluetoothReader class represents ACS Bluetooth readers. More...

#import <ABTBluetoothReader.h>

Inheritance diagram for ABTBluetoothReader:
ABTAcr1255uj1Reader ABTAcr3901us1Reader

Instance Methods

(void) - attachPeripheral:
 Attaches the reader to the peripheral. More...
 
(void) - detach
 Detaches the peripheral. More...
 
(BOOL) - getDeviceInfoWithType:
 Gets the device information. More...
 
(BOOL) - authenticateWithMasterKey:
 Authenticates the reader. More...
 
(BOOL) - authenticateWithMasterKey:length:
 Authenticates the reader. More...
 
(BOOL) - powerOnCard
 Powers on the card. More...
 
(BOOL) - powerOffCard
 Powers off the card. More...
 
(BOOL) - getCardStatus
 Gets the card status. More...
 
(BOOL) - transmitApdu:
 Transmits the APDU. More...
 
(BOOL) - transmitApdu:length:
 Transmits the APDU. More...
 
(BOOL) - transmitEscapeCommand:
 Transmits the escape command. More...
 
(BOOL) - transmitEscapeCommand:length:
 Transmits the escape command. More...
 

Protected Attributes

BOOL _attached
 
CBPeripheral * _peripheral
 

Properties

id< ABTBluetoothReaderDelegatedelegate
 The delegate object specified to receive the Bluetooth reader events. More...
 

Detailed Description

The ABTBluetoothReader class represents ACS Bluetooth readers.

Author
Godfrey Chung
Version
1.0, 5 May 2014

Method Documentation

- (void) attachPeripheral: (CBPeripheral *)  peripheral

Attaches the reader to the peripheral.

Parameters
peripheralthe peripheral.
- (BOOL) authenticateWithMasterKey: (NSData *)  masterKey

Authenticates the reader.

Parameters
masterKeythe master key. The length must be 16 bytes.
Returns
YES if the reader is attached, otherwise NO.
- (BOOL) authenticateWithMasterKey: (const uint8_t *)  masterKey
length: (NSUInteger)  length 

Authenticates the reader.

Parameters
masterKeythe master key.
lengththe master key length. The length must be 16 bytes.
Returns
YES if the reader is attached, otherwise NO.
- (void) detach

Detaches the peripheral.

- (BOOL) getCardStatus

Gets the card status.

In order to proceed this operation, your reader must be authenticated. When the Bluetooth reader returns the card status, it calls the bluetoothReader:didReturnCardStatus:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Returns
YES if the reader is attached, otherwise NO.
See also
- authenticateWithMasterKey:
- authenticateWithMasterKey:length:
- (BOOL) getDeviceInfoWithType: (ABTBluetoothReaderDeviceInfo type

Gets the device information.

When the Bluetooth reader returns the device information, it calls the bluetoothReader:didReturnDeviceInfo:type:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Parameters
typethe device information type.
Returns
YES if the reader is attached and the device information type is supported, otherwise NO.
- (BOOL) powerOffCard

Powers off the card.

In order to proceed this operation, your reader must be authenticated. When the Bluetooth reader powers off the card, it calls the bluetoothReader:didPowerOffCardWithError: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Returns
YES if the reader is attached, otherwise NO.
See also
- authenticateWithMasterKey:
- authenticateWithMasterKey:length:
- (BOOL) powerOnCard

Powers on the card.

In order to proceed this operation, your reader must be authenticated. When the Bluetooth reader powers on the card, it calls the bluetoothReader:didReturnAtr:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Returns
YES if the reader is attached, otherwise NO.
See also
- authenticateWithMasterKey:
- authenticateWithMasterKey:length:
- (BOOL) transmitApdu: (NSData *)  apdu

Transmits the APDU.

In order to proceed this operation, your reader must be authenticated. When the Bluetooth reader returns the response APDU, it calls the bluetoothReader:didReturnResponseApdu:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Parameters
apduthe command APDU.
Returns
YES if the reader is attached, otherwise NO.
See also
- authenticateWithMasterKey:
- authenticateWithMasterKey:length:
- (BOOL) transmitApdu: (const uint8_t *)  apdu
length: (NSUInteger)  length 

Transmits the APDU.

In order to proceed this operation, your reader must be authenticated. When the Bluetooth reader returns the response APDU, it calls the bluetoothReader:didReturnResponseApdu:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Parameters
apduthe command APDU.
lengththe command APDU length.
Returns
YES if the reader is attached, otherwise NO.
See also
- authenticateWithMasterKey:
- authenticateWithMasterKey:length:
- (BOOL) transmitEscapeCommand: (NSData *)  command

Transmits the escape command.

When the Bluetooth reader returns the escape response, it calls the bluetoothReader:didReturnEscapeResponse:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Parameters
commandthe escape command.
Returns
YES if the reader is attached, otherwise NO.
- (BOOL) transmitEscapeCommand: (const uint8_t *)  command
length: (NSUInteger)  length 

Transmits the escape command.

When the Bluetooth reader returns the escape response, it calls the bluetoothReader:didReturnEscapeResponse:error: (ABTBluetoothReaderDelegate-p) method of its delegate object.

Parameters
commandthe escape command.
lengththe escape command length.
Returns
YES if the reader is attached, otherwise NO.

Member Data Documentation

- (BOOL) _attached
protected
- (CBPeripheral*) _peripheral
protected

Property Documentation

- (id<ABTBluetoothReaderDelegate>) delegate
readwritenonatomicweak

The delegate object specified to receive the Bluetooth reader events.


The documentation for this class was generated from the following file: