SCPDiscoveryDelegate
Objective-C
@protocol SCPDiscoveryDelegate <NSObject>
Swift
protocol DiscoveryDelegate : NSObjectProtocol
Implement this protocol to handle a continually updating list
of discovered readers. You must pass an SCPDiscoveryDelegate
when calling -[SCPTerminal discoverReaders:delegate:completion:]
.
-
This method will be called repeatedly until:
- an error occurs
-[SCPTerminal discoverReaders:delegate:completion:]
is canceled via theSCPCancelable
that it returned.-[SCPTerminal connectReader:completion:]
is called with a discovered reader
You should not cache the
SCPReader
objects in the readers array. In other words, after callingconnectReader:
with a discovered reader, you should not attempt to cache and re-use theReader
object. The connectivity information associated with the discoveredReader
object will become stale. If no readers have been founddidUpdateDiscoveredReaders
will be called with an empty array.Bluetooth Scan
When discovering a reader using this method, this
didUpdateDiscoveredReaders
delegate method will be called multiple times as the Bluetooth scan proceeds.Your app should display an updating list of discovered readers if your user is connecting to a reader for the first time.
Otherwise, you may automatically select a previously saved reader. Once a selection has been made, call the
connectReader
method to begin connecting to the reader.Bluetooth Proximity
When discovering a reader using this method, this
didUpdateDiscoveredReaders
delegate method will be called once. The reader’s LEDs will begin flashing.Internet
When discovering a reader using this method, the
didUpdateDiscoveredReaders
delegate method will only be called once. Both readers online and offline will be sent todidUpdateDiscoveredReaders
. Only an online reader can be connected to, so it will be up to you to check its network status. If you have not registered any readers to your accountdidUpdateDiscoveredReaders
will be called with an empty array. Note that this discovery method is currently only compatable with VerifoneP400.Declaration
Objective-C
- (void)terminal:(nonnull SCPTerminal *)terminal didUpdateDiscoveredReaders:(nonnull NSArray<SCPReader *> *)readers;
Swift
func terminal(_ terminal: Terminal, didUpdateDiscoveredReaders readers: [SCPReader])
Parameters
terminal
The originating SCPTerminal.
readers
The discovered readers.