SHARE
TWEET

Untitled

a guest Jun 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Discover active devices
  2. [[sdk scannerManager] discoverDevices:WDASocketExtensionUUID //Get the active SocketScanner handheld barcode scanner
  3.                                 completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
  4.     //Register for updates on device statuses and action results
  5.     //Add Scanner delegate to receive the data after the barcode was read
  6.     //Implement the method: -(void)gistdevice:(WDAcceptTerminal*)device dataReceived:(NSData *)dataReceived;
  7.     [[sdk scannerManager] addScannerDelegate:self
  8.                                        forScanner:[devices firstObject]];//for simplicity we will use the first active SocketScanner device
  9. }];
  10.  
  11. //Discover active devices
  12. [[sdk scannerManager] discoverDevices:WDADatecsPrinterExtensionUUID //Get the active Datecs DPP-250 handheld printer
  13.                            completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
  14.     //Register for updates on device statuses and action results
  15.    //Add Printer delegate to receive notifications about the paper status
  16.    //Implement the method: -(void)gistdevice:(WDAcceptTerminal*)device paperStatusUpdated:(AcceptPrinterPaperStatus)status
  17.    [[sdk printerManager] addPrinterDelegate:self
  18.                                  forPrinter:[devices firstObject]];//for simplicity we use the first active DPP-250
  19. }];
  20.  
  21. //Discover active devices
  22. [[sdk scannerManager] discoverDevices:WDADatecsPrinterExtensionUUID //Get the active Cash Drawer
  23.                            completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
  24.    //Register for updates on device statuses and action results
  25.    //Add Cash drawer delegate to receive the notifications about connection status and battery levels
  26.    //Implement the methods: -(void)gistdevice:(WDAcceptTerminal*)device connectionStatusDidChange:(AcceptExtensionConnectionStatus)connectionsStatus
  27.    //                      -(void)gistdevice:(WDAcceptTerminal*)device batteryLevelDidChange:(NSInteger)batteryLevel
  28.    [[self.sdk cashDrawerManager] addManagerDelegate:self
  29.                                           forDevice:cashDrawer];//for simplicity we use the first active Cash Drawer
  30.  }];
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top