Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. // The SDK is initialized as shared instance so can be accessed
  2. // from multiple View Controllers
  3. let sdk:AcceptSDK = AcceptSDK.sharedInstance()
  4.  
  5. // Set the SDK target environment - in this case Public Test
  6. // and the username and password to authenticate to it
  7. sdk.setup(with: AcceptEnvironment.publicTest,
  8. username: "yourUsername",
  9. password: "yourPassword")
  10.  
  11. // Define the array to hold the list of paired and connected BT terminals
  12. var returnedTerminalsArr:[WDAcceptTerminal]?
  13.  
  14. // Completion from the Terminal Discovery API
  15. let completionTerminals = {(arr: [WDAcceptTerminal]?, err:Error?) in
  16. returnedTerminalsArr = arr
  17. }
  18.  
  19.  
  20. // Discover all paired and connected Posmate terminals - Spire is producing Posmate | SPm2 | Spm20 which are all served by PosMateExtension
  21. sdk.terminalManager.discoverDevices(AcceptExtensionTypeUUID.PosMateExtensionUUID, // Vendor UUID - Spire terminals have the UUID of PosMateExtensionUUID
  22. completion:completionTerminals) // completion to be executed at the end of discovery method
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement