ACS Bluetooth iOS/Mac OS X Library  1.0.0
 All Classes Files Functions Variables Typedefs Enumerator Properties
ABTBluetoothReader.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 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 
13 enum {
14 
17 
20 
23 
26 
29 };
30 
32 typedef NSUInteger ABTBluetoothReaderCardStatus;
33 
35 enum {
36 
39 
42 
45 };
46 
49 
51 enum {
52 
55 
58 
61 
64 
67 
70 };
71 
73 typedef NSUInteger ABTBluetoothReaderDeviceInfo;
74 
75 @class CBPeripheral;
77 
83 @interface ABTBluetoothReader : NSObject {
84 
85 @protected
86  BOOL _attached;
87  CBPeripheral *_peripheral;
88 }
89 
91 @property (nonatomic, weak) id<ABTBluetoothReaderDelegate> delegate;
92 
97 - (void)attachPeripheral:(CBPeripheral *)peripheral;
98 
100 - (void)detach;
101 
111 - (BOOL)getDeviceInfoWithType:(ABTBluetoothReaderDeviceInfo)type;
112 
119 - (BOOL)authenticateWithMasterKey:(NSData *)masterKey;
120 
128 - (BOOL)authenticateWithMasterKey:(const uint8_t *)masterKey length:(NSUInteger)length;
129 
140 - (BOOL)powerOnCard;
141 
152 - (BOOL)powerOffCard;
153 
164 - (BOOL)getCardStatus;
165 
177 - (BOOL)transmitApdu:(NSData *)apdu;
178 
191 - (BOOL)transmitApdu:(const uint8_t *)apdu length:(NSUInteger)length;
192 
202 - (BOOL)transmitEscapeCommand:(NSData *)command;
203 
214 - (BOOL)transmitEscapeCommand:(const uint8_t *)command length:(NSUInteger)length;
215 
216 @end
217 
222 @protocol ABTBluetoothReaderDelegate <NSObject>
223 @optional
224 
231 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didAttachPeripheral:(CBPeripheral *)peripheral error:(NSError *)error;
232 
240 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didReturnDeviceInfo:(NSObject *)deviceInfo type:(ABTBluetoothReaderDeviceInfo)type error:(NSError *)error;
241 
248 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didChangeCardStatus:(ABTBluetoothReaderCardStatus)cardStatus error:(NSError *)error;
249 
256 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didChangeBatteryStatus:(ABTBluetoothReaderBatteryStatus)batteryStatus error:(NSError *)error;
257 
264 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didChangeBatteryLevel:(NSUInteger)batteryLevel error:(NSError *)error;
265 
271 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didAuthenticateWithError:(NSError *)error;
272 
280 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didReturnAtr:(NSData *)atr error:(NSError *)error;
281 
287 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didPowerOffCardWithError:(NSError *)error;
288 
295 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didReturnCardStatus:(ABTBluetoothReaderCardStatus)cardStatus error:(NSError *)error;
296 
303 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didReturnResponseApdu:(NSData *)apdu error:(NSError *)error;
304 
311 - (void)bluetoothReader:(ABTBluetoothReader *)bluetoothReader didReturnEscapeResponse:(NSData *)response error:(NSError *)error;
312 
313 @end
No card is present.
Definition: ABTBluetoothReader.h:19
The battery is full.
Definition: ABTBluetoothReader.h:41
Hardware revision string.
Definition: ABTBluetoothReader.h:66
The card is present and inactive.
Definition: ABTBluetoothReader.h:22
BOOL _attached
Definition: ABTBluetoothReader.h:86
The card status is unknown.
Definition: ABTBluetoothReader.h:16
The ABTBluetoothReader class represents ACS Bluetooth readers.
Definition: ABTBluetoothReader.h:83
System ID.
Definition: ABTBluetoothReader.h:54
Manufacturer name string.
Definition: ABTBluetoothReader.h:69
Model number string.
Definition: ABTBluetoothReader.h:57
No battery.
Definition: ABTBluetoothReader.h:38
Serial number string.
Definition: ABTBluetoothReader.h:60
The USB is plugged.
Definition: ABTBluetoothReader.h:44
NSUInteger ABTBluetoothReaderDeviceInfo
Device information type.
Definition: ABTBluetoothReader.h:73
NSUInteger ABTBluetoothReaderBatteryStatus
Battery status type.
Definition: ABTBluetoothReader.h:48
Firmware revision string.
Definition: ABTBluetoothReader.h:63
The card is present and active.
Definition: ABTBluetoothReader.h:25
The reader is in power saving mode.
Definition: ABTBluetoothReader.h:28
The ABTBluetoothReaderDelegate protocol defines the response sent to a delegate of ABTBluetoothReader...
Definition: ABTBluetoothReader.h:222
NSUInteger ABTBluetoothReaderCardStatus
Card status type.
Definition: ABTBluetoothReader.h:32
CBPeripheral * _peripheral
Definition: ABTBluetoothReader.h:87