Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Discover active devices
- [[sdk scannerManager] discoverDevices:WDASocketExtensionUUID //Get the active SocketScanner handheld barcode scanner
- completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
- //Register for updates on device statuses and action results
- //Add Scanner delegate to receive the data after the barcode was read
- //Implement the method: -(void)gistdevice:(WDAcceptTerminal*)device dataReceived:(NSData *)dataReceived;
- [[sdk scannerManager] addScannerDelegate:self
- forScanner:[devices firstObject]];//for simplicity we will use the first active SocketScanner device
- }];
- //Discover active devices
- [[sdk scannerManager] discoverDevices:WDADatecsPrinterExtensionUUID //Get the active Datecs DPP-250 handheld printer
- completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
- //Register for updates on device statuses and action results
- //Add Printer delegate to receive notifications about the paper status
- //Implement the method: -(void)gistdevice:(WDAcceptTerminal*)device paperStatusUpdated:(AcceptPrinterPaperStatus)status
- [[sdk printerManager] addPrinterDelegate:self
- forPrinter:[devices firstObject]];//for simplicity we use the first active DPP-250
- }];
- //Discover active devices
- [[sdk scannerManager] discoverDevices:WDADatecsPrinterExtensionUUID //Get the active Cash Drawer
- completion:^(NSArray <WDAcceptTerminal *>* _Nullable devices, NSError* _Nullable devicesError){
- //Register for updates on device statuses and action results
- //Add Cash drawer delegate to receive the notifications about connection status and battery levels
- //Implement the methods: -(void)gistdevice:(WDAcceptTerminal*)device connectionStatusDidChange:(AcceptExtensionConnectionStatus)connectionsStatus
- // -(void)gistdevice:(WDAcceptTerminal*)device batteryLevelDidChange:(NSInteger)batteryLevel
- [[self.sdk cashDrawerManager] addManagerDelegate:self
- forDevice:cashDrawer];//for simplicity we use the first active Cash Drawer
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement