ABCircleTerminalFactory
public class ABCircleTerminalFactory : Status
SmartCardIO - AB Circle specific TerminalFactory Class
A factory for CardTerminal objects. It allows an application to:
- obtain a TerminalFactory by calling one of the static factory methods in this class (getDefault() or getInstance()).
- use this TerminalFactory object to access the CardTerminals by calling the terminals() method.
This TerminalFactory is using the following standard type name: “PC/SC” - an implementation that calls into the PC/SC Smart Card stack of the host platform.
Note: This TerminalFactory is the default and only TerminalFactory available for use.
-
Returns the default TerminalFactory instance (of type ABCircleTerminalFactory).
Declaration
Swift
public static func getDefault() -> ABCircleTerminalFactory
Return Value
Instance of ABCircleTerminalFactory
-
Returns the default TerminalFactory instance if the type matches. Note: only added for completion, it is recommended to simply use getDefault() to get the default TerminalFactory instance instead,
Throws
Status.StatusCode on failure (see enum Status.StatusCode for possible values)
Declaration
Swift
public static func getInstance(type: String, params: AnyObject? = nil, provider: String = "") throws -> ABCircleTerminalFactory
Parameters
type
Type of TerminalFactory to return
params
Parameters to pass to the TerminalFactory (ignored)
provider
Provider of the TerminalFactory to return (ignored)
Return Value
instance of ABCircleTerminalFactory
-
Get the default TerminalFactory type.
Declaration
Swift
public func getDefaultType() -> String
Return Value
Default TerminalFactory type
-
Get the type of this TerminalFactory.
Declaration
Swift
public func getType() -> String
Return Value
TerminalFactory type
-
Starts a scan for bluetooth peripherals in range for a default time of 10 seconds and no filter on name.
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func scanBluetooth() throws
-
Starts a scan for bluetooth peripherals in range for the entered duration time in seconds and no filter on name.
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func scanBluetooth(durationInSeconds: Int) throws
Parameters
durationInSeconds
Duration of the scan in seconds
-
Scans for bluetooth readers in range for for a default time of 10 seconds using the entered name filter
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func scanBluetooth(name: String) throws
Parameters
name
Filter reader by name (case insensitive)
-
Scans for bluetooth readers in range for the entered duration using the entered name filter
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func scanBluetooth(durationInSeconds: Int, name: String) throws
Parameters
durationInSeconds
Duration in seconds for the scan
name
Filter reader by name (case insensitive)
-
Sets a reader filter on RSSI value, used when scanning for readers
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func setBluetoothRssiFilter(rssiValue: Int) throws
Parameters
rssiValue
Filter reader by rssi strength in decibels e.g. -50 for (~0.5m) -60 for (~1.0m)
-
Clears a custom encryption key set earlier for reader authentication and data encryption
Declaration
Swift
public func clearCustomEncryptionKey()
-
Sets a custom encryption key for reader authentication and data encryption The custom key should be 16 bytes long in hexadecimal string form (spaces are accepted), aka. “19 AB …”
Throws
An error status on failure (see enum Status.StatusCode for possible values)Declaration
Swift
public func setCustomEncryptionKey(customKeyString: String) throws
Parameters
customKeyString
Custom key string in hexadecimal form
-
Sets a custom encryption key for reader authentication and data encryption The custom key should be 16 bytes long
Throws
Status.StatusCode; .success on success, else an error status (see enum Status.StatusCode for possible values)Declaration
Swift
public func setCustomEncryptionKey(customKey: Data) throws
Parameters
customKey
Custom key in a Data buffer
-
Disconnects a reader completely (including the bluetooth peripheral)
Declaration
Swift
public func disconnect(cardTerminal: CardTerminal)
Parameters
readerSlotName
Name of reader slot of reader to disconnect
-
Returns a CardTerminals object encapsulating the terminals supported by this factory.
Declaration
Swift
public func terminals() -> CardTerminals
Return Value
CardTerminals object
-
Returns a string representation of this TerminalFactory.
Declaration
Swift
public func toString() -> String
Return Value
String representation of this TerminalFactory.