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 theSCPCancelablethat it returned.-[SCPTerminal connectReader:completion:]is called with a discovered reader
You should not cache the
SCPReaderobjects in the readers array. In other words, after callingconnectReader:with a discovered reader, you should not attempt to cache and re-use theReaderobject. The connectivity information associated with the discoveredReaderobject will become stale. If no readers have been founddidUpdateDiscoveredReaderswill be called with an empty array.Bluetooth Scan
When discovering a reader using this method, this
didUpdateDiscoveredReadersdelegate 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
connectReadermethod to begin connecting to the reader.Bluetooth Proximity
When discovering a reader using this method, this
didUpdateDiscoveredReadersdelegate method will be called once. The reader’s LEDs will begin flashing.Internet
When discovering a reader using this method, the
didUpdateDiscoveredReadersdelegate 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 accountdidUpdateDiscoveredReaderswill 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
terminalThe originating SCPTerminal.
readersThe discovered readers.