BluetoothTerminalManager
public class BluetoothTerminalManager : NSObject
extension BluetoothTerminalManager: CBCentralManagerDelegate
The BluetoothTerminalManager class manages card terminals.
Version
1.0Date
17 Nov 2017-
The terminal type
See moreDeclaration
Swift
public enum TerminalType -
This control code is to send escape command.
Declaration
Swift
public static let ioctlEscape: Int -
Declaration
Swift
public enum BatteryStatus -
Declaration
Swift
public enum DeviceInfoType : Int -
The delegate object you want to receive Bluetooth terminal manager events.
Declaration
Swift
public var delegate: BluetoothTerminalManagerDelegate? -
The central manager
Declaration
Swift
public private(set) var centralManager: CBCentralManager! { get } -
Starts the scanning for available card terminals.
Declaration
Swift
public func startScan(terminalType: TerminalType)Parameters
terminalTypethe terminal type. It can be
TerminalType.acr3901us1,TerminalType.acr1255uj1,TerminalType.amr220corTerminalType.acr1555u. -
Stops the scanning for available card terminals.
Declaration
Swift
public func stopScan() -
Gets the timeouts from the card terminal.
Declaration
Swift
public func timeouts(terminal: CardTerminal) throws -> TerminalTimeoutsParameters
terminalthe card terminal
Return Value
the timeouts
-
Sets the master key from the card terminal.
Since
0.3Declaration
Swift
public func setMasterKey(terminal: CardTerminal, masterKey: [UInt8]?) throwsParameters
terminalthe card terminal
masterKeythe master key
-
Gets the terminal type from the card terminal.
Since
0.3Declaration
Swift
public func terminalType(terminal: CardTerminal) throws -> TerminalTypeParameters
terminalthe card terminal
Return Value
the terminal type
-
Gets the battery status from the card terminal.
Since
0.4Throws
CardError.operationFailedif the card operation failedDeclaration
Swift
public func batteryStatus(terminal: CardTerminal, timeout: Int) throws -> BatteryStatusParameters
terminalthe card terminal
timeoutthe maximum time to wait in milliseconds
Return Value
the battery status
-
Gets the battery level from the card terminal.
Since
0.4Throws
CardError.operationFailedif the card operation failedDeclaration
Swift
public func batteryLevel(terminal: CardTerminal, timeout: Int) throws -> IntParameters
terminalthe card terminal
timeoutthe maximum time to wait in milliseconds
Return Value
the battery level. -1 if the card terminal does not support it.
-
Gets the device information.
Since
0.5Throws
CardError.operationFailedif the card operation failedDeclaration
Swift
public func deviceInfo(terminal: CardTerminal, type: BluetoothTerminalManager.DeviceInfoType, timeout: Int) throws -> String?Parameters
terminalthe card terminal
typethe device information type
timeoutthe maximum time to wait in milliseconds
Return Value
the device information. nil if the card terminal does not support it.
-
Disconnects the card terminal.
Declaration
Swift
public func disconnect(terminal: CardTerminal) throwsParameters
terminalthe card terminal
-
Undocumented
Declaration
Swift
public func centralManagerDidUpdateState(_ central: CBCentralManager) -
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) -
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) -
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didFailToConnect peripheral: CBPeripheral, error: Error?) -
Undocumented
Declaration
Swift
public func centralManager(_ central: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?)