ABCircleTerminalFactory

@objcMembers
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

  • Flag indicating if the ACK protocol should be enabled or not for connected readers that support it. The ACK protocol uses ACK and NACK packets to try to further stabilise communication and enables the possibility to recover communication errors in most cases. Set to true to enable the setting or false to disable it.

    Notes:

    • The setting will only be applied to newly connected readers
    • The ACK protocol is only supported for readers with firmware version 109.00 or above
    • Default is disabled (false)

    Declaration

    Swift

    public var ackProtocolEnabledForReaders: Bool { get set }
  • Discover bluetooth devices, stops after {@code scanDuration} milliseconds (10 second = 10000ms).

    Throws

    An error status on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func startReaderDiscovery(durationInSeconds: Int, caller: ReaderDiscoveredCallback?) throws

    Parameters

    durationInSeconds

    Duration of the scan in seconds

  • Discover bluetooth devices for the duration given.

    Throws

    An error status on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func startReaderDiscovery(durationInSeconds: Int) throws

    Parameters

    durationInSeconds

    Duration of the scan in seconds

  • Stop Reader Discovery

    Throws

    An error status on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func stopReaderDiscovery() throws
  • Returns an unmodifiable list of all discovered readers

    Declaration

    Swift

    public func getReaderDiscoveryList() -> [DiscoveredReader]?

    Return Value

    An unmodifiable list of all discovered readers

  • Discover bluetooth readers in range for a default duration 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 discoverBluetoothDevices(name: String) throws

    Parameters

    name

    Filter reader by name (case insensitive)

  • Attempts to connect to a discovered reader by its uuid string Note: success simply means the connection attempt succeeded, the connection itself can still fail..

    Throws

    An error status on failure (see enum Status.StatusCode for possible values)

    Declaration

    Swift

    public func connectByUUID(uuidString: String) throws

    Parameters

    uuidString

    UUID string of the discovered reader to connect to

  • 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

    cardTerminal

    CardTerminal object 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.