About Scanner SDK for iOS

Overview

The Zebra Scanner SDK for iOS is provided as an XCFramework bundle that can be integrated to a custom iOS application. The SDK provides an Application Programming Interface (API) that offers the communication facilities required to operate a supported Zebra scanner on the iOS platform and it enables the capability to manage connections, configure connected scanners, perform various operations with connected scanners, and to obtain information about connected scanners.

Supported Devices

For the compatible devices list, please visit following page.

https://www.zebra.com/us/en/support-downloads/software/developer-tools/scanner-sdk-for-iOS.html

The following MFi (Made for iPhone/iPod/iPad) Zebra scanners are currently supported by the iOS SDK.

Table 1: Supported Zebra Scanners

Zebra Scanner Configuration
CS4070 MFI SSI
CS6080 MFI SSI
DS8178 MFI SSI
RFD8500 Bluetooth MFi Server mode, with primary mode set to MFI SSI

The following Bluetooth low energy Zebra scanners currently supported by the iOS SDK.

Table 2: Supported Zebra Scanners

Zebra Scanner Configuration
CS6080 SSI over Bluetooth low energy
DS2278 SSI over Bluetooth low energy
DS3678 SSI over Bluetooth low energy
LI3678 SSI over Bluetooth low energy
DS8178 SSI over Bluetooth low energy

NOTE: To configure a device in the mode specified, refer to the appropriate Product Reference Guide, User Guide, or Integration Guide.

Table 3: Pairing Modes

Scanner Model Paring Barcode
Legacy STC Manual Pairing
CS6080 No Yes Yes
DS2278 No Yes Yes
LI3678 No Yes Yes
DS3678 No Yes Yes
CS4070 No No Yes
RFD8500 No No Yes
DS8178 Yes Yes Yes

System Requirements

The following system requirements are necessary in order to develop, test, and execute applications using the Zebra Scanner SDK for iOS:

  • Xcode 15 or later.
  • iOS SDK 15.0 or later.
  • Zebra Barcode Scanner SDK for iOS.
  • iPhone or iPad running iOS 15.0 or later.

Version History

Version 1.4.48 - 10/2026

  1. Added configuration update and SMS execution features to the SCA and SDK.
  2. Added DS8288 support to SCA.

Version 1.4.46 - 01/2026

  1. Added iOS 26 support. Note iOS 16 and older versions are no longer supported by Zebra's SDK.
  2. Introduced an API for filtering the peripheral scanning process from friendly name in BLE.
  3. Reduced scanning and detection intervals in BLE for faster connection establishment.
  4. Resolved firmware update plugin and .dat file validation issues in the SCA.
  5. Added iOS 26 support v1.0.5 SCA.

Version 1.4.44 - 12/2024

  1. Added iOS 18 support. Note iOS 15 and older versions no longer supported by Zebra's SDK.
  2. Updated Swift SCA to support the following features. Version 1.0.2
    1. Battery statistics
    2. Background notifications
    3. Virtual tether

Version 1.4.43 - 07/2024

  1. Enhanced XCFramework - M1 Chip now supported in the Simulator.
  2. Updated the SDK to support Apple's development recommendations - The "libsymbolbt-sdk.a" static library has been discontinued. This capability has been replaced with the “ZebraScannerSDK.xcframework”. Please refer to Zebra TechDoc documentation for integration instructions.
  3. Updated SCA to incorporate the XCFramework. Cut into Swift Zebra Scanner Control Application (SCA). Version 1.0.1
  4. Release of Scanner SDK for iOS as a Swift Package Manager (SPM) package. SPM is a dependency management tool integrated into Xcode. It simplifies the process of adding, updating, and managing third-party dependencies to Xcode projects and it handles building and linking dependencies automatically.

Version 1.4.41 - 04/2024

  1. Added support for firmware update in iOS 17.
  2. Disabled Scanner SDK logs.

Version 1.4.39 - 10/2023

  1. Added iOS 17 support.
    1. Scanner Firmware update in iOS 17 is temporarily not supported. This feature will be available in a future release. Note firmware update in older iOS versions like v16 and v15 function correctly.
  2. Zebra only supports the last 3 iOS versions from Apple. iOS v14 and older are no longer supported.

Version 1.4.38 - 04/2023

  1. Added ADF support for Barcode data. Now if an ADF rule is applied when connected to an iOS device, the ADF will be applied on output to the mobile device.

Version 1.4.37 - 01/2023

  1. Added auto-reconnect to last paired scanner upon application launch. This is achieved through an API which enables/disables auto reconnecting.

Version 1.4.35 - 10/2022

  1. Added iOS 16 support. Note iOS 13 and older versions no longer supported by Zebra's SDK.
  2. Bug Fix - If 1st paired scanner disconnects/goes out of range and new 2nd scanner paired, the Scanner Control App (SCA) and iOS SDK now interact properly with 2nd scanner.

Version 1.4.33 - 07/2022

  1. Added iOS 15 support. Note iOS 12 and older versions no longer supported by Zebra's SDK.

Version 1.4.32 - 01/2022

  1. Fixed Scan-To-Connect (STC) barcode issue on the Scanner Control App (SCA). STC barcode now, again defaults to the Bluetooth LE (BLE) comm protocol.

Version 1.4.31 - 10/2021

  1. Enhanced the Scanner Control App by adding a Scan-To-Connect (STC) barcode to the home screen.
  2. Enhanced the Scanner Control App based on Apple's API directive, we removed the "UIAlertView" API and replaced with Apple's recommended "UIAlertControl".

Version 1.4.30 - 08/2021

  1. Enhanced the Scanner Control app by adding “Virtual Tether” host side feedback (beeper, LED, vibration) when scanner goes out of range.
  2. Enhanced the Scanner Control app. For scanners connected to host manually (not using STC barcode) adding option to auto reconnect scanners.
  3. Bug Fix - Fixed a virtual tether alarm issue. Now upon reconnection of the scanner to the host, the virtual tether alarm stops.

Version 1.4.27 - 04/2021

  1. Enhanced “Virtual Tether” support to include host feedback (vibrate, message popup, LED and beeper) in the iOS SDK and Scanner Control App.
  2. Removed Bluetooth device friendly name support from the Scanner SDK and from the Scanner Control App (SCA).
  3. Fixed MFi device reconnect issue after firmware update.

Version 1.4.23 - 01/2021

  1. Removed Bluetooth device friendly name support from the Scanner SDK and from the Scanner Control App (SCA).

Version 1.4.19 - 10/2020

  1. Added iOS 14 support. Note iOS 11 and older versions are no longer supported by Zebra's SDK.
  2. Simplified setup of STC (Scan-To-Connect) pairing process for cordless BTLE (Bluetooth Low Energy) scanner. Utility automatically generates unique pairing sequence. Users no longer must enter the Bluetooth MAC Address from host iOS device into app.

Version 1.4.15 - 07/2020

  1. Added support for CS6080 Bluetooth scanner (Classic Bluetooth and BTLE).
  2. Added support for manufacturer data format (kCBAdvDataManufacturerData). Manuracturing data format was introduced by Apple with iOS v12.

Version 1.4.9 - 04/2020

  1. Faster wireless firmware update for select scanners over the Bluetooth Classic communication protocol. See 123Scan's release notes per scanner for product support details.

Version 1.4.8 - 01/2020

  1. Firmware update improvements
    1. Loading firmware is skipped if firmware to be loaded is already present on the device.
    2. Enhanced firmware failure handling including new error messages.
  2. Performance improvement when initially discovering Zebra scanners.
  3. Added support for CS6080 cordless Bluetooth scanner.

Version 1.4.7 - 06/2019

  1. Added iOS 13 support. Note iOS 10 and older versions no longer supported by Zebra's SDK
  2. Added MFi certification to iOS SDK for DS8178.

Version 1.4.6 - 11/2018

  1. Added iOS 12 support. Note iOS 9 and older versions no longer supported by Zebra's SDK.
  2. Bluetooth Low Energy (SSI LE) High Security feature support.

Version 1.4.5 - 06/2018

  1. Enable AutoReconnect for MFi scanners.

Version 1.3.9 - 01/2018

  1. Added iOS 11 support. Note iOS 8 and older versions no longer supported by Zebra's SDK.
  2. DS2278 and DS8178 support added.
  3. CS4070 firmware update support.

Version 1.2.0 - 09/2016

  1. SDK Changes,
    1. Aim control supported.
    2. Page motor supported.
    3. Firmware update supported.
    4. STC supported for BTLE scanners.

Version 1.1.0 - 02/2016

  1. Demo Application changes,
    1. Demo App name changed from “Zebra Scanner” to “Zebra Scanner Control”.
    2. Enhanced pairing and connection instructions.
    3. Miscellaneous user interface improvements.
    4. Release trigger button is disabled when connected to a CS4070 only.
    5. Button to permanently set Symbologies removed when connected to a CS4070 only.
    6. LED control button removed from Active scanner info section when connected to a RFD8500 only.
    7. Default communication mode set to MFi.

Version 1.0.0 - 10/2015

  1. Initial Barcode Scanner SDK for iOS release.

Installation and Configuration

Overview

This page describes the process required to install and execute the Zebra Scanner Control application that is provided with the Zebra Scanner SDK for iOS.

NOTE: The purpose of the scanner Zebra Scanner Control application is to demonstrate the various capabilities of the SDK library. It is not intended for production use purposes.

Installing the Zebra Scanner Control Application

Using the Source Code

Prerequisites

  • OS X
  • Xcode. Download Xcode from the Mac App Store.
  • An iOS Developer account with Apple.
  • A provisioned iOS device with iOS 15, or higher installed.

Launching the Zebra Scanner Control Application

To launch the application on the device:

  1. Connect a provisioned iOS device to your Mac.
  2. Open the ScannerSDKApp.xcodeproj project file.
  3. In the project navigator, choose your device from the Scheme toolbar menu.

    NOTE: If your iOS device is listed as an ineligible device, fix the issue before continuing. The version of iOS that is installed on the device must match the deployment target set in the project.

  4. Click the Run button. Xcode installs the application on the device.
  5. If a warning message appears that states No matching provisioning profile found, click the Fix Issue button. Xcode needs to add the device to the team provisioning profile before it can launch the application on the device.
  6. If a prompt appears that asks whether or not codesign may sign the application using a key in your keychain, click Always Allow.
  7. The application launches on your device.

From the Apple App Store

Prerequisites

  • An iOS device with iOS 15, or higher, installed.

Launching the Zebra Scanner Control Application

To launch the scanner application on the device from the Apple App Store:

  1. Launch the App Store application on your iOS device.
  2. Search for the Zebra Scanner application, or Zebra Scanner Control application by Zebra Technologies.
  3. Tap the Get button next to the application, then tap the Install button.

Launching the Zebra Scanner Control Application

  1. Before launching the application, set the Zebra scanner to the appropriate configuration. See Supported Scanners to determine the required configuration needed for your Zebra scanner.
  2. Enable Bluetooth on your iOS device and pair it with the Bluetooth Zebra scanner, if it is not paired already. Refer to the relevant Product Reference Guide, User Guide, or Integration Guide for instructions on how to pair the device.
  3. Launch the application by selecting the Zebra Scanner Control application from your device's home screen. The following screen displays:
    Figure 1: Pair New Scanner
  4. Connect to a scanner.

    Prior to connecting a scanner if any settings are required to be updated, those can be updated by navigating to the 'More → App Settings' tab. Ex: Communication Mode, Set Factory Defaults. The screen is as follows.

    Figure 2: App Settings

    1. Connect a BLE scanner: Scan the STC (Scan To Connect) pairing barcode on the 'BT LE' tab to connect a BLE scanner (See the Figure 1).
    2. Connect a MFi supported scanner: Navigate to 'More → Connection Help → Pairing Help' for the pairing information and pair a MFi supported scanner. Navigate to 'MFi' tab and select the paired MFi scanner on the list to connect.
    Figure 3: Connect MFi Scanners

  5. When a scanner is connected to the application a set of scanner settings are displayed in the 'Settings' tab. At the bottom of the screen, three more tabs: 'Data View', 'Advanced', and 'More , each offering other additional features are displayed.
    1. Select the Settings' tab to access basic scanner settings including 'Beeper', 'LED Control', 'Symbologies' and etc.
      Figure 4: Scanner Settings

    2. To control which symbologies the scanner reads, select the Symbologies option. An on/off control switch appears next to each barcode type displayed in the menu.
      Figure 5: Symbologies

      NOTE: Custom symbology settings can be configured via 123Scan.

    3. Select the 'Data View' tab to view scanned barcodes. This screen also includes an option to view sample barcodes for scanning.
      Figure 6: Data View

    4. Select the 'Advanced' tab to access Asset Information, Update Firmware and etc.
      Figure 7: Advanced Settings

Features Supported in Scanner Control App

  1. Display barcode data within a tablet/phone application.
  2. Apps using the SDK can command and control the scanner.
    1. LED and Beeper Control.
    2. Aim Control.
    3. Enable/disable Symbologies.
    4. Scanner control,
      1. Remote scanner trigger (i.e. Host app-initiated triggering).
      2. Enable/disable scanning.
    5. Automatic reconnection to last connected scanner (i.e. scanner goes out range and then returns).
    6. Enable/Disable the pager vibrating motor.
  3. Device Configuration (Get, Set and Store Scanner attributes).
  4. Asset tracking,
    1. Model number
    2. Serial number
    3. Date of manufacture
    4. Firmware version
  5. Simplified pairing using Scan-To-Connect technology.
  6. Enables image and video capture.
  7. Update scanner firmware.
  8. Auto connection to the last connected scanner on app relaunch with Bluetooth Low Energy mode.

Configuring the Xcode Project

The Zebra Scanner SDK for iOS consists of an XCFramework that can be linked with an external iOS application and a set of necessary header files.

Migrating to the XCFramework (ZebraScannerSDK.xcframework) from the static library(libsymbolbt-sdk.a)

  1. Delete the existing static library(libsymbolbt-sdk.a) from the project.

    Figure 8: Delete the static library from a Xcode project

  2. Delete existing Library and User Header Search Paths from the Build Settings.

    Figure 9: Delete Library and User Header Search Paths

  3. Add ZebraScannerSDK.xcframework to the project.

    Copy the ZebraScannerSDK.xcframework provided by Zebra Technologies into the project folder. Select the Project Target, click on Build Phases → Link Binary With Libraries → + Mark → Add Files.

    Figure 10: Add ZebraScannerSDK.xcframework to a Xcode project

  4. Embed and Sign the ZebraScannerSDK.xcframework in General → Frameworks, Libraries, and Embedded Content

    Figure 11: Embed and Sign

  5. Make sure Runpath Search Paths in the Build Settings is as follows.

    Figure 12: Runpath Search Paths

  6. Import Framework headers where it is necessary.

    If the existing Xcode project is an Objective C one, replace the new framework headers with Framework module name like below.

    Figure 13: Import Framework headers to an Objective C project

    If the existing Xcode project is a Swift one, replace the new framework headers with Framework module name in the bridging header file as below.

    Figure 14: Import Framework headers to a Swift project

Add Zebra Scanner SDK to a new Xcode project

  1. Create a new Xcode project and save it to a new project folder.
  2. Open the new project in Xcode and select your project in the file navigator sidebar.
  3. Configure the Xcode project to support one or more external accessory communication protocols through the UISupportedExternalAccessoryProtocols key in your application Info.plist file or via the Info tab of your project settings.

    Table 4: Communication Protocols

    Communication Protocols Zebra Scanner
    com.motorolasolutions.CS4070_ssi CS4070
    com.zebra.scanner.SSI CS6080
    DS8178
    RFD8500

    Figure 15: Supported external accessory protocols

  4. In order to configure your application to communicate with Bluetooth scanners in a background mode, configure your Xcode project to specify the background modes that your application supports using the UIBackgroundModes key in your application Info.plist file or via the Info tab of your project settings.

    Figure 16: Required background modes

  5. Set Property List Key NSBluetoothAlwaysUsageDescription to use the device's Bluetooth interface. Description value should be a string.

    Example: "Zebra Scanner Control App uses Bluetooth to find, connect and communicate with nearby Zebra devices. Please grant access".

    Figure 17: Privacy - Bluetooth Always Usage Description

  6. Add Zebra Scanner SDK (XCFramework bundle)

    1. Copy the ZebraScannerSDK.xcframework provided by Zebra Technologies into the new Xcode project folder.

      Select your Target, and then navigate to it's "Build Phases" tab. Expand the "Link Binary With Libraries" item. Add the following frameworks by clicking the + button:

      • ZebraScannerSDK.xcframework
      • ExternalAccessory
      • CoreBluetooth
      Figure 18: Link Binary with Libraries

    2. Embed and Sign the ZebraScannerSDK.xcframework in General → Frameworks, Libraries, and Embedded Content.

      Figure 19: Embed and Sign

  7. Add Zebra Scanner SDK (Swift Package)

    Zebra iOS Scanner SDK is available to download as a Swift Package on v1.4.43 onwards.

    1. Navigate to the Project → Package Dependencies → Add(+)

      Figure 20: Open SPM Window

    2. Enter the repository URL: https://github.com/ZebraDevs/Zebra-Scanner-SDK-iOS-SPM in the SPM window and add the package.

      Figure 21: Add the Package

    3. Add other required frameworks.

      Select your Target, and then its Build Phases tab. Expand the Link Binary With Libraries item. Add the following frameworks by clicking the add(+) button:

      • ExternalAccessory
      • CoreBluetooth
      Figure 22: Add other required frameworks

  8. Make sure Runpath Search Paths in the Build Settings as follows.

    Figure 23: Runpath Search Paths

  9. Import Framework headers where it is necessary.

    If the Xcode project is an Objective C one, import the framework headers with the Framework module name like below.

    Figure 24: Import Framework headers to an Objective C project

    NOTE: With the above steps your Objective-C project will be configured to use the Zebra Scanner SDK for iOS. Further steps as given below are required to configure a Swift Project for accessing the Zebra Scanner SDK.

  10. Create a Bridging Header by adding a new header file to your Xcode project.

    • Select File → New → File.
    • Then select iOS and under Source, click Header File.
    • Name your file "YourProjectName-Bridging-Header.h". Example: "Scanner", the file is named "Scanner-Bridging-Header.h".
    • Create the header file.
  11. Setting the Objective-C Bridging Header path.

    • Select your Target and then navigate to the Build Settings tab.
    • Navigate to Swift Compiler - General section in Build Settings tab.
    • Set Objective-C Bridging Header path.
    • Next to Objective-C Bridging Header, you will need to add the path of your header file as follows. $(SWIFT_MODULE_NAME)/ YourBridgingHeaderFileName.h
    Figure 25: Objective-C Bridging Header

  12. Adding Framework header files to the bridging header file.

    • Open your newly created bridging header file.
    • Import all the Framework header files as below.
    Figure 26: Framework headers in Bridging header

  13. Any headers listed in the bridging header file will be accessible from your Swift classes without importing those files.
  14. Your Swift project is now configured to use the Zebra Scanner SDK for iOS.

NOTE: When bridging an Objective-C interface to Swift, int type in Objective-C is bridged as Int32 in Swift. Therefore, it requires to be casted manually when accessing SDK APIs in Swift.


SDK Guide

Overview

This chapter provides detailed examples that demonstrate how to develop iOS applications on both Objective C and Swift using the Zebra Scanner Software Development Kit (SDK).

Zebra Scanner SDK iOS is written in Objective-C. Hence to access the SDK in Swift projects, it requires a bridging header to be created. Refer Configuring the Xcode Project section in Setup for more information.

Accessing the SDK

Create an instance of the Zebra Scanner SDK for iOS API inside of a class that conforms to the ISbtSdkApiDelegate. All available API functions are defined by the ISbtSdkApi Objective-C protocol. A single shared instance of an API object that implements the ISbtSdkApi can be obtained via createSbtSdkApiInstance method of the SbtSdkFactory class.

Swift
Objective C

// Get instance to the Zebra Scanner SDK API
weak var   apiInstance = SbtSdkFactory.createSbtSdkApiInstance()

// Get the SDK version string
var sdkVersion = apiInstance?.sbtGetVersion() ?? ""


#import <ZebraScannerSDK/SbtSdkFactory.h>

// Get instance to the Zebra Scanner SDK API
id <ISbtSdkApi> apiInstance = [SbtSdkFactory createSbtSdkApiInstance];

// Get the SDK version string
NSString *version = [apiInstance sbtGetVersion]; 

Event Handling

The SDK supports a set of asynchronous notifications to inform the application about scanner related events. This includes connectivity related events (i.e., the appearance of a scanner) and scanner action events (i.e., received barcode data). All supported callbacks are defined by the ISbtSdkApiDelegate Objective-C protocol.

In order to receive asynchronous notifications from the SDK, the application performs the following steps:

  1. Create an object that implements the ISbtSdkApiDelegate.

    Swift
    Objective C
    
    // Definition of a class that implements the ISbtSdkApiDelegate protocol
    class EventReceiver  : NSObject, ISbtSdkApiDelegate {
        // TODO: variables
    }
    
    // TODO: methods definition
    
    
    
    #import <ZebraScannerSDK/ISbtSdkApi.h>
    
    // Definition of a class that implements the ISbtSdkApiDelegate protocol 
    @interface EventReceiver : NSObject <ISbtSdkApiDelegate> {
        // TODO: variables
    }
    
    // TODO: methods definition
    
    
  2. Register the created object as notification receiver via the sbtSetDelegate function.

    Swift
    Objective C
    
    // Registration of the callback interface with the SDK
    var eventListener = EventReceiver()
    apiInstance?.sbtSetDelegate(eventListener)
    
    
    
    // Registration of the callback interface with SDK 
    EventReceiver *eventListener = [[EventReceiver alloc] init];
    [apiInstance sbtSetDelegate:eventListener];
    
    
  3. Subscribe for specific asynchronous events using the sbtSubscribeForEvents method to specify which events should be reported by the SDK.

    Valid notification/event mask values include:

    • SBT_EVENT_BARCODE
    • SBT_EVENT_SCANNER_APPEARANCE
    • SBT_EVENT_SCANNER_DISAPPEARANCE
    • SBT_EVENT_SESSION_ESTABLISHMENT
    • SBT_EVENT_SESSION_TERMINATION
    • SBT_EVENT_RAW_DATA.

    Swift
    Objective C
    
    // Subscribe to scanner appearance/disappearance, session establishment/termination and barcode event notifications.
    
    apiInstance?.sbtSubsribe(forEvents: Int32(SBT_EVENT_SCANNER_APPEARANCE) | Int32(SBT_EVENT_SCANNER_DISAPPEARANCE) |Int32(SBT_EVENT_SESSION_ESTABLISHMENT) | Int32(SBT_EVENT_SESSION_TERMINATION) | Int32(SBT_EVENT_BARCODE))
    
    
    
    // Subscribe to scanner appearance/disappearance, session establishment/termination and barcode event notifications.
    
    [apiInstance sbtSubsribeForEvents:SBT_EVENT_SCANNER_APPEARANCE | SBT_EVENT_SCANNER_DISAPPEARANCE | SBT_EVENT_SESSION_ESTABLISHMENT | SBT_EVENT_SESSION_TERMINATION | SBT_EVENT_BARCODE];    
    
    

Events

If an object is registered as a notification receiver, the SDK calls the corresponding method of the registered object when a particular event occurs and the application is subscribed for events of this type.

Scanner Appeared Event

This event occurs when the presence of a scanner appears.

Swift
Objective C

func sbtEventScannerAppeared(_ availableScanner: SbtScannerInfo!) {
    // TODO: Handle event
}                                                                


- (void)sbtEventScannerAppeared:(SbtScannerInfo*)availableScanner {
    // TODO: Handle event
}

Scanner Disappeared Event

This event occurs when a scanner is no longer present.

Swift
Objective C

func sbtEventScannerDisappeared(_ scannerID: Int32) {
    // TODO: Handle event
}                                                                


- (void) sbtEventScannerDisappeared:(int)scannerID {
    // TODO: Handle event
}

Communication Session Established Event

This event occurs when communication is established with a scanner.

Swift
Objective C

func sbtEventCommunicationSessionEstablished(_ activeScanner: SbtScannerInfo!) {
    // TODO: Handle event
}                                                                


- (void) sbtEventCommunicationSessionEstablished:(SbtScannerInfo*)activeScanner {
    // TODO: Handle event
}

Communication Session Terminated Event

This event occurs when communication with a scanner is terminated.

Swift
Objective C

func sbtEventCommunicationSessionTerminated(_ scannerID: Int32) {
    // TODO: Handle event
}                                                                


- (void) sbtEventCommunicationSessionTerminated:(int)scannerID {
    // TODO: Handle event
}

Barcode Data Received Event

This event occurs when barcode data is read and received.

Swift
Objective C

func sbtEventBarcodeData(_ barcodeData: Data!, barcodeType: Int32, fromScanner scannerID: Int32) {    
    // TODO: Handle event
}                                                                


- (void) sbtEventBarcodeData:(NSData *)barcodeData barcodeType:(int)barcodeType fromScanner:(int)scannerID {
    // TODO: Handle event
}

Firmware Update Event

This event occurs when firmware update is in progress. You don't need to specifically subscribe to this event. You just have to implement this delegate method.

Swift
Objective C

func sbtEventFirmwareUpdate(_ fwUpdateEventObj: FirmwareUpdateEvent!) {
    // TODO: Handle event
}                                                                


- (void) sbtEventFirmwareUpdate:(FirmwareUpdateEvent*)event {
    // TODO: Handle event
}

Connectivity Management

The SDK identifies scanners as "available" and "active". An "available" scanner is a scanner that is connected to the iOS device via Bluetooth, but has not yet established a communication session with the SDK. An "active" scanner is a scanner that is both connected to the iOS device via Bluetooth, and has established a communication session with the SDK.

The SDK supports simultaneous interaction with multiple scanners. To distinguish between various scanners, the SDK assigns a unique integer identifier for each scanner when it becomes available for the first time.

Set Operation Mode

Zebra Scanner SDK for iOS is designed to support interaction with scanners operating in BT MFi or BT LE mode. The SDK shall be configured to enable communication with a particular type of scanner by setting the operation mode.

Use the sbtSetOperationalMode function to set the required operational mode of the scanners to interface with.

Valid inputs include:

  • SBT_OPMODE_MFI
  • SBT_OPMODE_BTLE
  • SBT_OPMODE_ALL.
Swift
Objective C

// Set operational mode to all so that SDK can interface with scanners operating in MFI or BTLE mode.
apiInstance?.sbtSetOperationalMode(Int32(SBT_OPMODE_ALL))


// Set operational mode to all so that SDK can interface with scanners operating in MFI or BTLE mode.
[apiInstance sbtSetOperationalMode:SBT_OPMODE_ALL];

Enable Scanner Detection

The SDK supports automatic detection of appearance and disappearance of available scanners. When the "Available scanners detection" option is enabled, the SDK updates its internal list of available scanners and deliver a corresponding asynchronous notification once it detects connection or disconnection of a particular scanner to the iOS device via Bluetooth. If the option is disabled, the SDK updates its internal list of available scanners only when requested by the application via the sbtGetAvailableScannersList.

Use the sbtEnableAvailableScannersDetection method to actively detect appearance and disappearance of scanners.

Swift
Objective C

// Actively detect appearance/disappearance of scanners
apiInstance?.sbtEnableAvailableScannersDetection(true)                                                                


// Actively detect appearance/disappearance of scanners 
[apiInstance sbtEnableAvailableScannersDetection:YES];

Get Available and Active Scanners

The SDK maintains an internal list of active and available scanners. The following example demonstrates how to receive a list of available and active scanners from the SDK.

Swift
Objective C

// Allocate an array to store the list of available scanners.
var availableScannerList: NSMutableArray? = NSMutableArray()

// Allocate an array to store the list of active scanners.
var activeScannerList: NSMutableArray? = NSMutableArray()

// Retrieve the list of currently available scanners.
apiInstance?.sbtGetAvailableScannersList(&availableScannerList)

// Retrieve the list of currently active scanners. 
apiInstance?.sbtGetActiveScannersList(&activeScannerList)


// Allocate an array to store the list of available scanners. 
NSMutableArray *availableScanners = [[NSMutableArray alloc] init];

// Allocate an array to store the list of active scanners. 
NSMutableArray *activeScanners = [[NSMutableArray alloc] init];

// Retrieve the list of currently available scanners.
[apiInstance sbtGetAvailableScannersList:&availableScanners];

// Retrieve the list of currently active scanners.
[apiInstance sbtGetActiveScannersList:&activeScanners];

Connect to a Scanner

There are two methods to establish a connection with a scanner,

  1. Using Scan-To-Connect (STC) Pairing Barcode.
  2. Using the Manual pairing method.

Connect a Scanner Using Scan-To-Connect (STC) Pairing Barcode

Table 5: BARCODE_TYPE Attribute Values

Description Attribute Values
STC type BARCODE_TYPE_STC

Table 6: STC_COM_PROTOCOL Attribute Values

Description Attribute Values
SSI Bluetooth Low Energy STC_SSI_BLE

Table 7: SETDEFAULT_STATUS Attribute Values

Description Attribute Values
Enable Set Default SETDEFAULT_YES
Disable Set Default SETDEFAULT_NO

The following code example demonstrates how to get the STC pairing barcode.

Swift
Objective C

// Create an UIImageView with desired size for the STC pairing barcode.
var imageView = UIImageView(frame: CGRect(x: 40, y: 230, width: 240, height: 115))

// Get "Set Factory Defaults" disabled STC pairing barcode as an UIImage.
var stcBarcodeImage: UIImage = apiInstance?.sbtGetPairingBarcode(BARCODE_TYPE_STC, withComProtocol: STC_SSI_BLE, withSetDefaultStatus: SETDEFAULT_NO, withImageFrame: imageView.frame) ?? UIImage()

//Set UIImage to the created UIImageVIew. 
imageView.image = stcBarcodeImage


// Create an UIImageView with desired size for the STC pairing barcode.
UIImageView *imageVIew = [[UIImageView alloc] initWithFrame:CGRectMake(40,230,240,115)];

// Get "Set Factory Defaults" disabled STC pairing barcode as an UIImage.
UIImage  *stcPairingBarcode = [apiInstance sbtGetPairingBarcode:BARCODE_TYPE_STC withComProtocol:STC_SSI_BLE withSetDefaultStatus:SETDEFAULT_NO withImageFrame:imageVIew.frame];

//Set UIImage to the created UIImageVIew.
[imageVIew setImage:stcPairingBarcode];

After scanning the STC pairing barcode, the scanner will be paired and get connected. Then the sbtEventCommunicationSessionEstablished event gets triggered.

Figure 27: Zebra Scanner Control - STC Pairing Barcode

Using Manual Pairing

You can establish a connection with an available scanner by providing the scanner ID to the SDK's sbtEstablishCommunicationSession method.

Swift
Objective C

// Attempt to establish a connection with the scanner device that has an ID = 3.
let result = apiInstance?.sbtEstablishCommunicationSession(Int32(3))

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful connection
} else {
    // TODO: Process error (unsuccessful connection)
}


// Attempt to establish a connection with the scanner device that has an ID = 3. 
SBT_RESULT result = [apiInstance sbtEstablishCommunicationSession:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful connection
}
else {
    // TODO: Process error (unsuccessful connection)
}

Disconnect from a Scanner

You can disconnect from an active scanner using the SDK's sbtTerminateCommunicationSession method.

Swift
Objective C

// Attempt to disconnect from the scanner device that has an ID = 3.
let result = apiInstance?.sbtTerminateCommunicationSession(Int32(3))

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful disconnection
} 
else {
    // TODO: Process error (unsuccessful disconnection)
}


// Attempt to disconnect from the scanner device that has an ID = 3. 
SBT_RESULT result = [apiInstance sbtTerminateCommunicationSession:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful disconnection
}
else {
    // TODO: Process error (unsuccessful connection) 
}

Automatically Reconnect to a Scanner

The SDK supports "Automatic Session Reestablishment" option is used to automatically reconnect to a scanner that unexpectedly disappeared. If the "Automatic Session Reestablishment" option is enabled for a specific scanner, the SDK automatically attempts to reestablish a connection with the scanner when it becomes available again. The option has no effect if the application has intentionally terminated a communication session with the scanner via the sbtTerminateCommunicationSession function.

Use the sbtEnableAutomaticSessionReestablishment function to enable or disable automatic reconnection for a specific scanner.

Swift
Objective C

// Set the automatic session reestablishment option for scanner ID 3 
let result = apiInstance  ?.sbtEnableAutomaticSessionReestablishment(true, forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Option successfully set
} 
else {
    // TODO: Error (option was not set)
}                                                                


// Set the automatic session reestablishment option for scanner ID 3 
SBT_RESULT result = [apiInstance sbtEnableAutomaticSessionReestablishment:YES forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Option successfully set
}
else {
    // TODO: Error (option was not set)
}

Automatically connect to the last connected scanner on app relaunch

The SDK supports "Auto connect to the last connected Scanner" option to automatically connect to the last connected scanner during app relaunch in Bluetooth Low Energy (BLE) mode. This option is disabled by default and if the "Auto connect to the last connected Scanner" option is enabled, the SDK automatically attempts to establish a connection with the last connected scanner during app relaunch.

Use sbtAutoConnectToLastConnectedScannerOnAppRelaunch function to enable or disable this feature. Call this function after initiating the SDK.

Swift
Objective C

// Automatically attempts to establish a connection with the last connected scanner during app relaunch.
apiInstance?.sbtAutoConnectToLastConnectedScanner(onAppRelaunch: true)


// Automatically attempts to establish a connection with the last connected scanner during app relaunch.
[apiInstance sbtAutoConnectToLastConnectedScannerOnAppRelaunch:YES];

Performing Operations

The Zebra Scanner iOS SDK provides the capability to perform various scanner operations such as:

  • Adjusting beeper settings
  • Turning the LED on and off
  • Enabling and disabling scanning
  • Enabling and disabling supported symbologies
  • Pulling and releasing the trigger
  • Turning AIM on and off
  • Activate page motor.

Get Beeper Settings

The get attribute command (SBT_RSM_ATTR_GET) is used to retrieve the beeper volume and frequency attribute values. The attribute values are returned from the scanner as an XML formatted string.

Table 8: Beeper Setting Attributes

Attribute Description Attribute Name
Beeper Volume RMD_ATTR_BEEPER_VOLUME
Beeper Frequency RMD_ATTR_BEEPER_FREQUENCY

The following code example demonstrates how to retrieve the scanner's current beeper volume and frequency settings.

Swift
Objective C

// Create XML string to request beeper volume and frequency settings for scanner ID 3
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-xml><attrib_list>\(RMD_ATTR_BEEPER_VOLUME),\(RMD_ATTR_BEEPER_FREQUENCY)</attrib_list></arg-xml></cmdArgs></inArgs>"

var outXml:NSMutableString  ? = NSMutableString()

// Retrieve beeper volume and frequency settings from Scanner ID 3
let result = self.apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_GET),aInXML: inXML, aOutXML: &outXml,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing requested beeper settings
} 
else {
    // TODO: Process error
}                                                                


#import <ZebraScannerSDK/RMDAttributes.h>

// Create XML string to request beeper volume and frequency settings for scanner ID 3
NSString *xmlInput = [NSString stringWithFormat:@"
<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_list>%d,%d</attrib_lis t></arg-xml></cmdArgs></inArgs>",3, RMD_ATTR_BEEPER_VOLUME, RMD_ATTR_BEEPER_FREQUENCY];

NSMutableString *xmlResponse = [[NSMutableString] alloc] init];

// Retrieve beeper volume and frequency settings from Scanner ID 3 
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_GET aInXML:xmlInput aOutXML:&xmlResponse forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing requested beeper settings 
}
else {
    // TODO: Process error
}

Set Beeper Volume

The set attribute command (SBT_RSM_ATTR_SET) is used to set the value of the beeper volume attribute (RMD_ATTR_BEEPER_VOLUME).

Table 9: Beeper Volume Attribute Values

Description Attribute Values
Low Beeper Volume RMD_ATTR_VALUE_BEEPER_VOLUME_LOW
Medium Beeper Volume RMD_ATTR_VALUE_BEEPER_VOLUME_MEDIUM
High Beeper Volume RMD_ATTR_VALUE_BEEPER_VOLUME_HIGH

The following code example demonstrates how to set the scanner's beeper volume:

Swift
Objective C

// Create XML string to set the beeper volume on scanner ID 3 to LOW.
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>\(RMD_ATTR_BEEPER_VOLUME)</id><datatype>B</datatype><value>\(RMD_ATTR_VALUE_BEEPER_VOLUME_LOW)</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>"

// Command Scanner ID 3 to set beeper volume to LOW.
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_SET),aInXML: inXML, aOutXML: nil, forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


#import <ZebraScannerSDK/RMDAttributes.h>

// Create XML string to set the beeper volume on scanner ID 3 to LOW. 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>%d</id><datatype>B</datatype><value>%d</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>",3, RMD_ATTR_BEEPER_VOLUME, RMD_ATTR_VALUE_BEEPER_VOLUME_LOW];

// Command Scanner ID 3 to set beeper volume to LOW.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_SET aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Set Beeper Frequency

The set attribute command (SBT_RSM_ATTR_SET) is used to set the value of the beeper frequency attribute (RMD_ATTR_BEEPER_FREQUENCY).

Table 10: Beeper Frequency Attribute Values

Description Attribute Values
Beeper Frequency Low RMD_ATTR_VALUE_BEEPER_FREQ_LOW
Beeper Frequency Medium RMD_ATTR_VALUE_BEEPER_FREQ_MEDIUM
Beeper Frequency High RMD_ATTR_VALUE_BEEPER_FREQ_HIGH

The following code example demonstrates how to set the scanner's beeper frequency.

Swift
Objective C

// Create XML string to set the beeper frequency on scanner ID 3 to HIGH.
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>\(RMD_ATTR_BEEPER_FREQUENCY)</id><datatype>B</datatype><value>\(RMD_ATTR_VALUE_BEEPER_FREQ_HIGH  )</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>"

// Command Scanner ID 3 to set beeper frequency to HIGH.
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_SET),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


#import <ZebraScannerSDK/RMDAttributes.h>

// Create XML string to set the beeper frequency on scanner ID 3 to HIGH. 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>%d</id><datatype>B</datatype><value>%d</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>",3, RMD_ATTR_BEEPER_FREQUENCY, RMD_ATTR_VALUE_BEEPER_FREQ_HIGH];

// Command Scanner ID 3 to set beeper frequency to HIGH.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_SET aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Beep Control

Command the scanner's beeper to emit sound by using the sbtExecuteCommand API. Use command op code SBT_SET_ACTION and an attribute value shown in table below.

Table 11: Beeper Attribute Values

Description Attribute Values
One high short beep RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_1
Two high short beeps RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_2
Three high short beeps RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_3
Four high short beeps RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_4
Five high short beeps RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_5
One low short beep RMD_ATTR_VALUE_ACTION_LOW_SHORT_BEEP_1
Two low short beeps RMD_ATTR_VALUE_ACTION_LOW_SHORT_BEEP_2
Three low short beeps RMD_ATTR_VALUE_ACTION_LOW_SHORT_BEEP_3
Four low short beeps RMD_ATTR_VALUE_ACTION_LOW_SHORT_BEEP_4
Five low short beeps RMD_ATTR_VALUE_ACTION_LOW_SHORT_BEEP_5
One high long beep RMD_ATTR_VALUE_ACTION_HIGH_LONG_BEEP_1
Two high long beeps RMD_ATTR_VALUE_ACTION_HIGH_LONG_BEEP_2
Three high long beeps RMD_ATTR_VALUE_ACTION_HIGH_LONG_BEEP_3
Four high long beeps RMD_ATTR_VALUE_ACTION_HIGH_LONG_BEEP_4
Five high long beeps RMD_ATTR_VALUE_ACTION_HIGH_LONG_BEEP_5
One low long beep RMD_ATTR_VALUE_ACTION_LOW_LONG_BEEP_1
Two low long beeps RMD_ATTR_VALUE_ACTION_LOW_LONG_BEEP_2
Three low long beeps RMD_ATTR_VALUE_ACTION_LOW_LONG_BEEP_3
Four low long beeps RMD_ATTR_VALUE_ACTION_LOW_LONG_BEEP_4
Five low long beeps RMD_ATTR_VALUE_ACTION_LOW_LONG_BEEP_5
Fast warble beep RMD_ATTR_VALUE_ACTION_FAST_WARBLE_BEEP
Slow warble beep RMD_ATTR_VALUE_ACTION_SLOW_WARBLE_BEEP
High-low beep RMD_ATTR_VALUE_ACTION_HIGH_LOW_BEEP
Low-high beep RMD_ATTR_VALUE_ACTION_LOW_HIGH_BEEP
High-low-high beep RMD_ATTR_VALUE_ACTION_HIGH_LOW_HIGH_BEEP
Low-high-low beep RMD_ATTR_VALUE_ACTION_LOW_HIGH_LOW_BEEP

The following code example demonstrates how to command the scanner's beeper to emit a high short beep sound.

Swift
Objective C

// Specify the scanner ID 3 and attribute value of the beeper command in the XML.
let inXML:String = "3\(RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_1)"

// Execute   the beep command.
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_SET_ACTION),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


#import <ZebraScannerSDK/RMDAttributes.h>

// Specify the scanner ID 3 and attribute value of the beeper command in the XML.
NSString *inXML = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-int>%d</arg-int></cmdArgs></inArgs>", 3, RMD_ATTR_VALUE_ACTION_HIGH_SHORT_BEEP_1];

// Execute the beep command.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_SET_ACTION aInXML:inXML aOutXML:nil forScanner: 3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation.
}
else {
    // TODO: Process error.
}       

LED Control

Control the scanner's LED by using the sbtExecuteCommand API. Use command opcode SBT_SET_ACTION and an attribute value shown in tha table below.

Table 12: LED Attribute Values

Description Attribute Values
Turn Green LED off RMD_ATTR_VALUE_ACTION_LED_GREEN_OFF
Turn Green LED on RMD_ATTR_VALUE_ACTION_LED_GREEN_ON
Turn Yellow LED on RMD_ATTR_VALUE_ACTION_LED_YELLOW_ON
Turn Yellow LED off RMD_ATTR_VALUE_ACTION_LED_YELLOW_OFF
Turn Red LED on RMD_ATTR_VALUE_ACTION_LED_RED_ON
Turn Red LED off RMD_ATTR_VALUE_ACTION_LED_RED_OFF

The following code example demonstrates how to command the scanner's LED to illuminate green.

Swift
Objective C

// Specify the scanner ID = 3 and attribute value of the LED command in the XML.
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-int>\(RMD_ATTR_VALUE_ACTION_LED_GREEN_ON)</arg-int></cmdArgs></inArgs>"

// Execute   the LED command.
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_SET_ACTION),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


#import <ZebraScannerSDK/RMDAttributes.h>

// Specify the scanner ID 3 and attribute value of the LED command in the XML 
NSString *inXML = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-int>%d</arg-int></cmdArgs></inArgs>", 3, RMD_ATTR_VALUE_ACTION_LED_GREEN_ON];

// Execute the LED command
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_SET_ACTION aInXML:inXML aOutXML:nil forScanner: 3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation.
}
else {
    // TODO: Process error.
}       

Enable Scanning

The scan enable command (SBT_DEVICE_SCAN_ENABLE) is used to enable the device's scanning capability. The following code example demonstrates how to enable the scan capability.

Swift
Objective C

// Create XML string to enable scanning on scanner ID 3
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"

// Command scanner ID 3 to enable scanning
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_SCAN_ENABLE),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to enable scanning on scanner ID 3 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command scanner ID 3 to enable scanning
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_SCAN_ENABLE aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Disable Scanning

The scan disable command (SBT_DEVICE_SCAN_DISABLE) is used to disable the device's scanning capability. The following code example demonstrates how to disable the scan capability.

Swift
Objective C

// Create XML string to disable scanning on scanner ID 3
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"

// Command scanner ID 3 to disable scanning
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_SCAN_DISABLE),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to disable scanning on scanner ID 3 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command scanner ID 3 to disable scanning
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_SCAN_DISABLE aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Get Supported Symbology IDs

The get all attributes command (SBT_RSM_ATTR_GETALL) is used to retrieve all the attributes of a scanner. All attributes will be returned from the scanner as an XML formatted string. Supported symbology list of a scanner can be filtered out by processing the attribute list. Following table includes valid symbology attribute values.

Table 13: Symbology Attribute Values

Description Attribute Values
UPC-A RMD_ATTR_SYM_UPC_A
UPC-E RMD_ATTR_SYM_UPC_E
UPC-E1 RMD_ATTR_SYM_UPC_E_1
EAN-8/JAN8 RMD_ATTR_SYM_EAN_8_JAN_8
EAN-13/JAN13 RMD_ATTR_SYM_EAN_13_JAN_13
Bookland EAN RMD_ATTR_SYM_BOOKLAND_EAN
Code 128 RMD_ATTR_SYM_CODE_128
UCC/EAN-128 RMD_ATTR_SYM_UCC_EAN_128
Code 39 RMD_ATTR_SYM_CODE_39
Code 93 RMD_ATTR_SYM_CODE_93
Code 11 RMD_ATTR_SYM_CODE_11
Interleaved 2 of 5 RMD_ATTR_SYM_INTERLEAVED_2_OF_5
Discrete 2 of 5 RMD_ATTR_SYM_DISCRETE_2_OF_5
Chinese 2 of 5 RMD_ATTR_SYM_CHINESE_2_OF_5
Codabar RMD_ATTR_SYM_CODABAR
MSI RMD_ATTR_SYM_MSI
Code 32 RMD_ATTR_SYM_CODE_32
Data Matrix RMD_ATTR_SYM_DATAMATRIXQR
PDF RMD_ATTR_SYM_PDF
ISBT 128 RMD_ATTR_SYM_ISBT_128
UCCCouponExtendedCode RMD_ATTR_UCC_COUPEN_EXTENDED_CODE
US Postnet RMD_ATTR_SYM_US_Postnet
US Planet RMD_ATTR_SYM_US_Planet
UKPost RMD_ATTR_SYM_UK_POST
USPostal Check Digit RMD_ATTR_SYM_US_POSTAL_CHECK_DIGIT
UKPostal Check Digit RMD_ATTR_SYM_UK_POSTAL_CHECK_DIGIT
JapanPost RMD_ATTR_SYM_JAPAN_POST
AusPost RMD_ATTR_SYM_AUS_POST
GS1DataBar14 RMD_ATTR_SYM_GS1_DATABAR_14
GS1DataBarLimited RMD_ATTR_SYM_GS1_DATABAR_LIMITED
GS1DataBarExpanded RMD_ATTR_SYM_GS1_DATABAR_EXPANDED
MicroPDF RMD_ATTR_SYM_MICRO_PDF
MaxiCode RMD_ATTR_SYM_MAXI_CODE
ISSN EAN RMD_ATTR_ISSN_EAN
Matrix 2 of 5 RMD_ATTR_MATRIX_2_OF_5
Korean 3 of 5 RMD_ATTR_KOREAN_3_OF_5
QR Code RMD_ATTR_QR_CODE
Micro QR Code RMD_ATTR_MICRO_QR
Aztec RMD_ATTR_AZTEC
HanXin RMD_ATTR_HANXIN
Composite CC-C RMD_ATTR_COMPOSITE_CC_C
Composite CC-A/B RMD_ATTR_COMPOSITE_CC_A_B
Composite TLC-39 RMD_ATTR_COMPOSITE_TLC_39
Netherlands KIX RMD_ATTR_SYM_Netherlands_KIX
UPU FICS RMD_ATTR_SYM_UPU_FICS
USPS 4CB/ONE Code/Intelligent Mail RMD_ATTR_SYM_USPS_4CB_ONECODE_INTELLIGENT_MAIL

The following code example demonstrates how to get all supported symbologies by using the get all attributes command.

Swift
Objective C

// Create XML string to request all   attributes of scanner ID 3 
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"
var outXml:NSMutableString  ? = NSMutableString()

// Retrieve all   attributes of scanner device that has an ID = 3 
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_GETALL),aInXML: inXML, aOutXML: &outXml,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing all attributes get supported symbologies
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to request all attributes of scanner ID 3 
NSString *xmlInput = [NSStringstringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",3]; 
NSMutableString *xmlResponse = [[NSMutableString] alloc] init];

// Retrieve all attributes of scanner device that has an ID = 3.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_GETALL aInXML:xmlInput aOutXML:&xmlResponse forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing all attributes to get supported symbologies
}
else {
    // TODO: Process error
}    

Get Symbology Values

The get attribute command (SBT_RSM_ATTR_GET) is used to retrieve the value of a symbology. The symbology value is returned from the scanner as an XML formatted string.

The following code example demonstrates how to retrieve the values of symbologies.

Swift
Objective C

// Create XML string to request value of supported symbology ID's 1 and 8 for scanner ID 3
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-xml><attrib_list>1,8<attrib_list></arg-xml></cmdArgs></inArgs>"
var outXml:NSMutableString? = NSMutableString()

// Retrieved values of symbologies for scanner ID = 3.
let result = self.apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_GET),aInXML: inXML, aOutXML: &outXml,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing symbology values.
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to request value of supported symbology ID's 1 and 8 for scanner ID 3
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_lis t>1,8</attrib_list></arg-xml></cmdArgs></inArgs>",3];
NSMutableString *xmlResponse = [[NSMutableString] alloc] init];

// Retrieved values of symbologies for scanner ID = 3.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_GET aInXML:xmlInput aOutXML:&xmlResponse forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process xml string containing symbology values 
}
else {
    // TODO: Process error
}

Set Symbology Values

The set attribute command (SBT_RSM_ATTR_SET) is used to set the value of a symbology. The symbology value is returned from the scanner as an XML formatted string.

The following code example demonstrates how to set the value of symbology.

Swift
Objective C

// Create XML string to set value of symbology ID 8 for scanner ID = 3 to "True"
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>8</id><datatype>F</datatype><value>True</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>"

// Set value of symbology ID 8 for scanner ID = 3 to "True"
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_SET),aInXML: inXML, aOutXML: nil,forScanner: Int32(scannerId))

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to set value of symbology ID 8 for scanner ID 3 to "True" 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>%d</id><datatype>F</datatype><value>%@</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>",3,8,"True"];

// Set value of symbology ID 8 for scanner ID = 3 to "True"
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_SET aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Pull Trigger

The pull trigger command (SBT_DEVICE_PULL_TRIGGER) is used to pull the device's trigger. The following code example demonstrates how to command the scanner's trigger to be pulled.

Swift
Objective C

// Create XML string to command scanner ID 3 to pull the trigger
let inXML:String = "3"

// Command scanner ID 3 to pull the trigger
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_PULL_TRIGGER),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


// Create XML string to command scanner ID 3 to pull the trigger 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command scanner ID 3 to pull the trigger
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_PULL_TRIGGER aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Release Trigger

The release trigger command (SBT_DEVICE_RELEASE_TRIGGER) is used to release the device's trigger. The following code example demonstrates how to command the scanner's trigger to be released.

Swift
Objective C

// Create XML string to command scanner ID 3 to release the trigger
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"

// Command scanner ID 3 to release the trigger
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_RELEASE_TRIGGER),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to command scanner ID 3 to release the trigger 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command scanner ID 3 to pull the trigger
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_RELEASE_TRIGGER aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

AIM On

The Aim On command (SBT_DEVICE_AIM_ON) is used to Aim on. The following code example demonstrates how to command the scanner's Aim function should be ON.

Swift
Objective C

// Create XML string to command scanner ID 3 to turn on the aim
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"
// Command scanner ID 3 to turn on the aim
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_AIM_ON),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} else {
    // TODO: Process error
}                                                                   


// Create XML string to command scanner ID 3 to turn on the aim 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",3];

// Command scanner ID 3 to turn on the aim
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_AIM_ON aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}    

AIM Off

The Aim Off command (SBT_DEVICE_AIM_OFF) is used to turn off the aim. The following code example demonstrates how to command the scanner to turn off the aim.

Swift
Objective C

// Create XML string to command scanner ID 3 to turn off the aim
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"
// Command scanner ID 3 to turn off the aim
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_AIM_OFF),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}    


// Create XML string to command scanner ID 3 to turn off the aim 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command scanner ID 3 to turn off the aim
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_AIM_OFF aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}    

Page Motor Function

The vibration feedback command (SBT_DEVICE_VIBRATION_FEEDBACK) is used to activate the page motor. The following code example demonstrates how to command the scanner's page motor to be activated.

Swift
Objective C

// Create XML string to command scanner ID 3 to activate the page motor
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"

// Command scanner ID 3 to activate the page motor
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_VIBRATION_FEEDBACK),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}


// Create XML string to command scanner ID 3 to activate page motor. 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>",scannerId];

// Command for scanner ID 3 to pull the page motor. 
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_DEVICE_VIBRATION_FEEDBACK aInXML:xmlInput aOutXML:nil forScanner: scannerId];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation.
}
else {
    // TODO: Process error.
}    

Update Firmware with DAT File

The firmware update command (SBT_UPDATE_FIRMWARE) is used to update firmware by DAT file. The following code example demonstrates how to command the scanner to update firmware by DAT file.

Swift
Objective C

// Create XML string to command scanner ID 3 to update firmware 
// selectedFWFilePath = absolute path of the DAT file
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-string>\(selectedFWFilePath)</arg-string></cmdArgs></inArgs>"

// Command scanner ID 3 to update firmware 
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_UPDATE_FIRMWARE),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}                                                                


// Create XML string to command scanner ID 3 to update firmware
// selectedFWFilePath = absolute path of the DAT file 
NSString *in_xml = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-string>%@</arg- string></cmdArgs></inArgs>", m_ScannerID, selectedFWFilePath];

// Command scanner ID 3 to update firmware
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_UPDATE_FIRMWARE aInXML:xmlInput aOutXML:nil forScanner:3];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}

Update Firmware with Plug-in File

The firmware update command (SBT_UPDATE_FIRMWARE_FROM_PLUGIN) is used to update firmware by plug-in file. The following code example demonstrates how to command the scanner to update firmware by plug-in file.

Swift
Objective C

// Create XML string to command scanner ID 3 to update firmware 
// selectedFWFilePath = absolute path of the plugin file
let inXML:String = "<inArgs><scannerID>3</scannerID><cmdArgs><arg-string>\(selectedFWFilePath)</arg-string></cmdArgs></inArgs>"

// Command scanner ID 3 to update firmware 
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_UPDATE_FIRMWARE_FROM_PLUGIN),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


// Create XML string to command scanner ID 3 to update firmware by plugin.
// selectedFWFilePath = absolute path of the plugin file. 
NSString *in_xml = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-string>%@</arg- string></cmdArgs></inArgs>", m_ScannerID, selectedFWFilePath];

// Command for scanner ID 3 to update firmware.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_UPDATE_FIRMWARE_FROM_PLUGIN aInXML:xmlInput aOutXML:nil forScanner: scannerId];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation.
}
else {
    // TODO: Process error.
}    

Abort Firmware Update

The abort firmware update command (SBT_DEVICE_ABORT_UPDATE_FIRMWARE) is used to abort ongoing firmware update.

Swift
Objective C

// Create XML string to command scanner ID 3 to abort the firmware update.
let inXML:String = "<inArgs><scannerID>3</scannerID></inArgs>"

// Command scanner ID 3 to abort firmware update
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_DEVICE_ABORT_UPDATE_FIRMWARE),aInXML: inXML, aOutXML: nil,forScanner: 3)

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}


// Create XML string to command scanner ID 3 to abort the firmware update.
NSString *in_xml = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID></inArgs>", scannerId];

// Command scanner ID 3 to abort the firmware update.
SBT_RESULT res = [apiInstance executeCommand:SBT_DEVICE_ABORT_UPDATE_FIRMWARE aInXML:in_xml aOutXML:nil forScanner:scannerId];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation.
}
else {
    // TODO: Process error.
}       

Virtual Tether

Virtual tether is designed to alert users when a device is taken out of range. It includes an audible, visual (includes the LEDs and illumination) and haptic alarm on the scanner if the Bluetooth connection is broken. Virtual tether alarm is disabled by default.

It is required to disable virtual tether alarm before performing a firmware update.

The store attribute command (SBT_RSM_ATTR_STORE) is used to store the value of the relevant attribute id for enabling or disabling the virtual tether alarm.

The following code example demonstrates how to enable the virtual tether alarm on the scanner.

Swift
Objective C
                                               
// Create XML string to set the value of attribute id (2053) to 1 of scanner ID 3. 
let inXML:String = "<inArgs><scannerID>\(scannerId)</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>\(attributeId)</id><datatype>B</datatype><value>1</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>"

// Store the value to enable the virtual tether alarm on the scanner id 3.
let result = apiInstance?.sbtExecuteCommand(Int32(SBT_RSM_ATTR_STORE),aInXML: inXML, aOutXML: nil,forScanner: Int32(scannerId))

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
} 
else {
    // TODO: Process error
}


// Create XML string to set the value of attribute id (2053) to 1 of scanner ID 3. 
NSString *xmlInput = [NSString stringWithFormat:@"<inArgs><scannerID>%d</scannerID><cmdArgs><arg-xml><attrib_list><attribute><id>%d</id><datatype>B</datatype><value>%@</value></attribute></attrib_list></arg-xml></cmdArgs></inArgs>",3, 2053,"1"];

// Store the value to enable the virtual tether alarm on the scanner id 3.
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_RSM_ATTR_STORE aInXML:xmlInput aOutXML:nil forScanner: scannerId];

if (result == SBT_RESULT_SUCCESS) {
    // TODO: Process successful operation
}
else {
    // TODO: Process error
}                                                    


Download Scanner SDK for iOS

IMPORTANT: Zebra recommends using the latest release whenever possible.


To Download Barcode Scanner SDK for iOS:

  1. Visit the Zebra Barcode Scanner SDK for iOS download page and select the desired download(s).
  2. Proceed to the Barcode Scanner SDK for iOS release notes for the version details.
  3. Proceed to the Barcode Scanner SDK for iOS setup page for installation instructions.
  4. To install the Zebra Scanner Control logged in to the App Store.