No part of this publication may be reproduced or used in any form, or by any electrical or mechanical means,
without permission in writing from Zebra. This includes electronic or mechanical means, such as photocopying,
recording, or information storage and retrieval systems. The material in this manual is subject to change
without notice.
The software is provided strictly on an “as is” basis. All software, including firmware, furnished to the user is on
a licensed basis. Zebra grants to the user a non-transferable and non-exclusive license to use each software
or firmware program delivered hereunder (licensed program). Except as noted below, such license may not be
assigned, sublicensed, or otherwise transferred by the user without prior written consent of Zebra. No right to
copy a licensed program in whole or in part is granted, except as permitted under copyright law. The user shall
not modify, merge, or incorporate any form or portion of a licensed program with other program material, create
a derivative work from a licensed program, or use a licensed program in a network without written permission
from Zebra. The user agrees to maintain Zebra’s copyright notice on the licensed programs delivered
hereunder, and to include the same on any authorized copies it makes, in whole or in part. The user agrees not
to decompile, disassemble, decode, or reverse engineer any licensed program delivered to the user or any
portion thereof.
Zebra reserves the right to make changes to any software or product to improve reliability, function, or design.
Zebra does not assume any product liability arising out of, or in connection with, the application or use of any
product, circuit, or application described herein.
No license is granted, either expressly or by implication, estoppel, or otherwise under any Zebra Technologies
Corporation, intellectual property rights. An implied license only exists for equipment, circuits, and subsystems
contained in Zebra products.
Warranty
For the complete Zebra hardware product warranty statement, go to:
http://www.zebra.com/warranty
.
Revision History
Changes to the original manual are listed below:
-01 Rev A - 10/2015Initial Release
-02 Rev A - 12/2015- Removed all references to sbtEstablishCommunicationSession:aRawPipeMode and
iii
all uses of rawPipeMode;
- Removed all references to sbtEventRawData
- Removed Raw Data Received Event section
- Removed the following line
in ISbtSdkApiDelegate - - (void) sbtEventRawData:(NSData*)rawData
fromScanner:(int)scannerID;
- Removed sbtEventRawData section and all references to sbtReadRawData
- Removed the following line:
(SBT_RESULT) sbtReadRawData:(unsigned char*)buffer maxLength:(int)length
bytesRead:(int*)bytesRead forScanner:(int)scannerID;
- Removed the sbtReadRawData section
- Removed all references to sbtWriteRawData
- Remove the following line:
(SBT_RESULT) sbtWriteRawData:(unsigned char*)buffer maxLength:(int)length
bytesWritten:(int*)bytesWritten forScanner:(int)scannerID;
- Removed sbtWriteRawData section.
- Updated Beep Control section, table, and code sample
- Removed the Turn Off The LED section.
- Replaced the entire Turn On the LED section
- Added a deprecation statement to sbtBeepControl
- Added a deprecation statement to sbtLedControl
- Added code to SbtScannerInfo
-03 Rev A - 1/2017- Updated CS4070 mode to MFI SSI in Table 1-1
- Several updates changing "pulled trigger on scanner ID" to "pulled updated firmware
on scanner ID"
- Several updates changing "scanner ID 3 to pull the trigger" to "scanner ID 3 to update
firmware"
- Added BT scanners to Table 1-2
- Added Table 1-3
- Added page motor support and AIM on and AIM off to Performing Operations section
- Added sbtSetBTAddress and sbtGetPairingBarcode
- Added descriptions for sbtSetBTAddress and sbtGetPairingBarcode
- Added tables: Firmware Update Result Code; STC Bar Code Types; STC Communication Protocol; Set Default Status
- Added sbtEventFirmwareUpdate
-04 Rev A - 6/2019- Added DS8178
ivZebra Scanner SDK for iOS Developer Guide
ChangeDateDescription
-03 Rev A01/2017
-04 Rev A07/2019
•
Updated CS4070 mode to MFI SSI in Table 1-1
•
Several updates changing "pulled trigger on scanner ID" to "pulled updated
firmware on scanner ID"
•
Several updates changing "scanner ID 3 to pull the trigger" to "scanner ID 3 to
update firmware"
•
Added BT scanners to Table 1-2
•
Added Table 1-3
•
Added page motor support and AIM on and AIM off to Performing Operations
section
•
Added sbtSetBTAddress and sbtGetPairingBarcode
•
Added descriptions for sbtSetBTAddress and sbtGetPairingBarcode
•
Added tables: Firmware Update Result Code; STC Bar Code Types; STC
Communication Protocol; Set Default Status
•
Added sbtEventFirmwareUpdate
•
Added DS8178 support.
TABLE OF CONTENTS
Warranty ......................................................................................................................................... ii
Revision History .............................................................................................................................. iii
About This Guide
Introduction ..................................................................................................................................... ix
Chapter Descriptions ...................................................................................................................... ix
Related Documents ........................................................................................................................ ix
Notational Conventions................................................................................................................... x
Service Information ......................................................................................................................... x
Chapter 1: INTRODUCTION to the ZEBRA SCANNER SDK for iOS
The Zebra Scanner SDK for iOSDeveloper Guide provides installation and programming information for the
Software Developer Kit (SDK) that allows Software Decode based applications for iOS based devices.
Chapter Descriptions
This guide includes the following topics:
•
Chapter 1, INTRODUCTION to the ZEBRA SCANNER SDK for iOS provides an overview of the Zebra
Scanner SDK for iOS.
•
Chapter 2, ZEBRA SCANNER CONTROL APPLICATION INST ALLATION and CONFIGURATION describes
the process required to install and execute the scanner Zebra Scanner Control application.
•
Chapter 3, SAMPLE SOURCE CODE provides detailed examples that demonstrate how to develop iOS
applications using the Zebra Scanner Software Development Kit (SDK).
•
Chapter 4, ZEBRA SCANNER SDK for iOS API defines the API that can be used by external applications to
connect remote scanners to a specific iOS device and control connected scanners.
Related Documents
•
Zebra Scanner SDK for Android Developer Guide, p/n MN002223Axx.
•
RFD8500 RFID Developer Guide, p/n MN002222Axx.
•
RFD8500 Quick Start Guide, p/n MN002225Axx.
•
RFD8500 Regulatory Guide, p/n MN002062Axx.
•
CRDUNIV-RFD8500-1R Three Slot Universal Cradle Charge Only Regulatory Guide, p/n MN002224Axx.
•
RFD8500 User Guide, p/n MN002065Axx.
For the latest version of this guide and all guides, go to: www.zebra.com/support.
xZebra Scanner SDK for iOS Developer Guide
Notational Conventions
This document uses the followingconventions:
•
The prefix SBT is used to reference Zebra Scanner SDK for iOS APIs.
•
The abbreviation for Bluetooth is BT.
•
SDK refers to the Zebra Scanner SDK for iOS.
•
Italics are used to highlight chapters, screen names, fields, and sections in this and related documents
•
bullets (•) indicate:
• Action items
• Lists of alternatives
• Lists of required steps that are not necessarily sequential
•
Sequential lists (e.g., those that describe step-by-step procedures) appear as numbered lists.
NOTE This symbol indicates something of special interest or importance to the reader. Failure to read the note
does not result in physical harm to the reader, equipment or data.
CAUTION This symbol indicates that if this information is ignored, the possibility of data or material damage may
occur.
WARNING! This symbol indicates that if this information is ignored the possibility that serious personal
Service Information
If you have a problem using the equipment, contact your facility's technical or systems support. If there is a
problem with the equipment, they contact the Zebra Technologies Global Customer Support Center at:
http://www.zebra.com/support.
When contacting Zebra support, please have the following information available:
•
Product name
•
Version number
Zebra responds to calls by e-mail, telephone or fax within the time limits set forth in support agreements.
If your problem cannot be solved by Zebra support, you may need to return your equipment for servicing and
will be given specific directions. Zebra is not responsible for any damages incurred during shipment if the
approved shipping container is not used. Shipping the units improperly can possibly void the warranty.
injury may occur.
If you purchased your business product from a Zebra business partner, contact that business partner for
support.
Chapter 1INTRODUCTION to the ZEBRA
SCANNER SDK for iOS
Overview
The Zebra Scanner SDK for iOS is provided as a static library that can be linked to a custom iOS application.
The static library provides an Application Programming Interface (API) to provide the communication facilities
required to operate a supported Zebra scanner on the iOS platform. The SDK provides the capability to
manage connections, configure connected scanners, perform various operations with connected scanners,
and to obtain information about connected scanners.
Supported Scanners
The following MFi (Made for iPhone/iPod/iPad) Zebra scanners are currently supported by the iOS SDK.
Table 1-1
CS4070MFI SSI
RFD8500Bluetooth MFi Server mode, with primary mode set to MFI SSI
Table 1-2 lists the Bluetooth low energy Zebra scanners currently supported by the iOS SDK.
Table 1-2
DS3678SSI over Bluetooth low energy
LI3678SSI over Bluetooth low energy
DS8178SSI over Bluetooth low energy
Supported Zebra Scanners
Zebra ScannerConfiguration
Supported Zebra Scanners
Zebra ScannerConfiguration
NOTE To configure a device in the mode specified, refer to the appropriate Product Reference Guide, User
Guide, or Integration Guide.
1 - 2Zebra Scanner SDK for iOS Developer Guide
Table 1-3
LI3678NoYesYes
DS3678NoYesYes
CS4070NoNoYes
RFD8500NoNoYes
DS8178YesYesYes
Pairing Modes
Pairing Bar Code
Scanner Model
LegacySTCManual Pairing
System Requirements
The following system requirements are necessary in order to develop, test, and execute applications using the
Zebra Scanner SDK for iOS:
•
Xcode 6, or later
•
iOS SDK 8.0, or later
•
Zebra Scanner SDK for iOS
•
iPhone or iPod Touch running iOS 8.0 or later.
Chapter 2ZEBRA SCANNER CONTROL
APPLICATION INSTALLATION
and CONFIGURATION
Introduction
This chapter 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.
2 - 2Zebra Scanner SDK for iOS Developer Guide
Installing the Zebra Scanner Control Application
Using the Source Code
Prerequisites
•
OS X.
•
Xcode. Download Xcode from the Mac App Store.
•
iOS 8, or higher, installed.
•
An iOS Developer account with Apple.
•
A provisioned iOS device.
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 8, 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.
ZEBRA SCANNER CONTROL APPLICATION INSTALLATION and CONFIGURATION2 - 3
Launching the Zebra Scanner Control Application
1.Before launching the application, set the Zebra scanner to the appropriate configuration. See Supported
Scanners on page 1-1 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 2-1
Scanner Application - Initial Screen
2 - 4Zebra Scanner SDK for iOS Developer Guide
+
4.Select Scanners from the menu. The following screen displays:
Figure 2-2
5.Select the device from the left panel, and then tap the Connect button from the Available Scanner
menu.The following screen displays:
Figure 2 - Scanner Application - Scanners Screen
Figure 2-3
Scanner Application - Available Scanner Screen
ZEBRA SCANNER CONTROL APPLICATION INSTALLATION and CONFIGURATION2 - 5
6.Once connected, the Active Scanner menu displays. This menu is used to select various options including
Info, Barcode, and Settings.
a.Select the Info tab to view the Scanner ID, Type, Name, and Auto Reconnection state. This tab also
contains functionality to control the Beeper and LED. The following screen displays:
Figure 2-4
b. Select the Barcode tab to view scanned bar codes, and to pull/release the scanner trigger.The
Scanner Application - Active Scanner Screen
following screen displays:
Figure 2-5
Scanner Application - Barcode screen
2 - 6Zebra Scanner SDK for iOS Developer Guide
c.Select the Settings tab to select supported Symbologies, configure the beeper volume and frequency,
and to enable/disable scanning.The following screen displays:
Figure 2-6
i.To control which symbologies the scanner reads, select the Symbologies option. An on/off control
Scanner Application - Settings Screen
switch appears next to each bar code type displayed in the menu.
Figure 2-7
NOTE Custom symbology settings can be configured via 123Scan
Scanner Application - Symbologies Screen
2
. When setting the Inter Character Delay for
HID only, set the delay in milliseconds between emulated keystrokes. When pairing with an Android
device, set the Inter Character Delay to 70 ms to avoid data loss.
ZEBRA SCANNER CONTROL APPLICATION INSTALLATION and CONFIGURATION2 - 7
Configuring the Xcode Project
The Zebra Scanner SDK for iOS consists of a static library that can be linked with an external iOS application
and a set of necessary header files.
To add the SDK:
1.Create a new Xcode project and save it to a new project folder.
2.Copy the symbolbt-sdk folder provided by Zebra Technologies into the new project folder. This folder
contains the libsymbolbt-sdk.a file and an include folder containing SDK header files.
3.Open the new project in Xcode, and select your project in the file navigator sidebar.
4.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 2-1
Communication Protocols
Communication ProtocolZebra Scanner
com.motorolasolutions.CS4070_ssiCS4070
com.zebra.scanner.SSI
RFD8500
com.motorolasolutions.scanner
5.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.
6.Select your Target, and then its Build Phases tab.
7.Expand the Link Binary With Libraries item.
8.Add the following frameworks by clicking the + button:
• libsymbolbt-sdk.a
• ExternalAccessory
• CoreBluetooth.
9.Select the Build Settings tab.
10. Navigate to the Search Paths section of the Build Settings.
11. Set User Header Search Paths to $(SRCROOT)/symbolbt-sdk/include/.
12. Your project is now configured to use the Zebra Scanner SDK for iOS.
2 - 8Zebra Scanner SDK for iOS Developer Guide
Chapter 3SAMPLE SOURCE CODE
Introduction
This chapter provides detailed examples that demonstrate how to develop iOS applications using the Zebra
Scanner Software Development Kit (SDK).
3 - 2Zebra Scanner SDK for iOS Developer Guide
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.
Code Snippet - Obtain Instance of API
// ....
@import "SbtSdkFactory.h"
// ....
// Get instance to the Zebra Scanner SDK API
id <ISbtSdkApi> apiInstance = [SbtSdkFactory createSbtSdkApiInstance];
// Get the SDK version string
NSString *version = [apiInstance sbtGetVersion];
NSLog(@"Zebra SDK version: %@\n", version);
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., appearance of a scanner), and scanner action events (i.e.,
received bar code 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.
Code Snippet - Create A Class That Implements Isbtsdkapidelegate
// 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.
Code Snippet - Set Delegate Of API Instance To Object That Implements ISbtSdkApiDelegate
// Registration of the callback interface with SDK
EventReceiver *eventListener = [[EventReceiver alloc] init];
[apiInstance sbtSetDelegate:eventListener];
SAMPLE SOURCE CODE3 - 3
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_IMAGE
• SBT_EVENT_VIDEO
• SBT_EVENT_SCANNER_APPEARANCE
• SBT_EVENT_SCANNER_DISAPPEARANCE
• SBT_EVENT_SESSION_ESTABLISHMENT
• SBT_EVENT_SESSION_TERMINATION
• SBT_EVENT_RAW_DATA.
Code Snippet - Subscribe To Scanner Events
// Subscribe to scanner appearance/disappearance, session establishment/termination,
// barcode, and image & video event notifications.
[apiInstance sbtSubsribeForEvents:SBT_EVENT_SCANNER_APPEARANCE |
SBT_EVENT_SCANNER_DISAPPEARANCE | SBT_EVENT_SESSION_ESTABLISHMENT |
SBT_EVENT_SESSION_TERMINATION | SBT_EVENT_BARCODE | SBT_EVENT_IMAGE |
SBT_EVENT_VIDEO];
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.
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.
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.
SAMPLE SOURCE CODE3 - 5
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.
Code Snippet - Set Operational Mode
// ....
// Set operational mode to all so that SDK can interface with scanners
// operating in MFI or BTLE mode.
[apiInstance sbtSetOperationalMode:SBT_OPMODE_ALL];
3 - 6Zebra Scanner SDK for iOS Developer Guide
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.
Code Snippet - Enable Auto Detection
// 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.
Code Snippet - Get Available And Active Scanners
// ....
// Allocate an array for storage of a list of available scanners
NSMutableArray *availableScanners = [[NSMutableArray alloc] init];
// Allocate an array for storage of a list of active scanners
NSMutableArray *activeScanners = [[NSMutableArray alloc] init];
// Retrieve a list of available scanners
[apiInstance sbtGetAvailableScanners:&availableScanners];
// Retrieve a list of active scanners
[apiInstance sbtGetActiveScanners:&activeScanners];
// Merge the available and active scanners into a single list
NSMutableArray *allScanners = [[NSMutableArray alloc] init];
[allScanners addObjectsFromArray:availableScanners];
[allScanners addObjectsFromArray:activeScanners];
// Print information for each available and active scanner
for (SbtScannerInfo *info in allScanners)
{
NSLog(@"Scanner is %@: ID = %d name = %@", (([info isActive] == YES) ?
You can establish a connection with an available scanner by providing the scanner ID to the SDK's
sbtEstablishCommunicationSession method.
Code Snippet - Connect To A Scanner
// ....
// 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
NSLog(@"Connection to scanner ID %d successful",scannerId);
}
else
{
// TODO: Process error (unsuccessful connection)
NSLog(@"Failed to establish a connection with scanner ID %d",scannerId);
}
Disconnect from a Scanner
You can disconnect from an active scanner using the SDK's sbtTerminateCommunicationSession
method.
Code Snippet - Disconnect From A Scanner
// ....
// 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
NSLog(@"Disconnect from scanner ID %d successful",scannerId);
}
else
{
// TODO: Process error (unsuccessful connection)
NSLog(@"Failed to disconnect from scanner ID %d",scannerId);
}
Automatically Reconnect to 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.
3 - 8Zebra Scanner SDK for iOS Developer Guide
Code Snippet - Enable Automatic Reconnection
// ....
// 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
NSLog(@"Automatic Session Reestablishment for scanner ID %d has been set
successfully",scannerId);
}
else
{
// TODO: Error (option was not set)
NSLog(@"Automatic Session Reestablishment for scanner ID %d could not be
set",scannerId);
}
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.
Beeper
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 3-1
Attribute DescriptionAttribute Name
Beeper Volume
Beeper Setting Attributes
RMD_ATTR_BEEPER_VOLUME
Beeper Frequency
The following code example demonstrates how to retrieve the scanner's current beeper volume and frequency
settings.
RMD_ATTR_BEEPER_FREQUENCY
SAMPLE SOURCE CODE3 - 9
Code Snippet - Retrieve Beeper Settings
// ....
// Create XML string to request beeper volume and frequency settings for
// 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
NSLog(@"Retrieved beeper settings from scanner ID %d:
%@",scannerId,xmlResponse);
}
else
{
// TODO: Process error
NSLog(@"Failed to retrieve beeper settings from scanner ID %d",scannerId);
}
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 3-2 includes valid volume attribute values.
// 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
NSLog(@"Successfully updated beeper settings for scanner ID %d:
%@",scannerId,xmlResponse);
}
else
{
// TODO: Process error
NSLog(@"Failed to update beeper settings from scanner ID %d",scannerId);
}
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 3-3 includes valid frequency attribute values.
// 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
NSLog(@"Successfully updated beeper settings for scanner ID %d:
%@",scannerId,xmlResponse);
}
else
{
// TODO: Process error
NSLog(@"Failed to update beeper settings from scanner ID %d",scannerId);
}
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 3-4 below:
Control the scanner's LED by using the sbtExecuteCommand API. Use command op code
SBT_SET_ACTION and an attribute value shown in Table 3-5 below.
Table 3-5
Turn Green LED offRMD_ATTR_VALUE_ACTION_LED_GREEN_OFF
Turn Green LED onRMD_ATTR_VALUE_ACTION_LED_GREEN_ON
Turn Yellow LED onRMD_ATTR_VALUE_ACTION_LED_YELLOW_ON
Turn Yellow LED offRMD_ATTR_VALUE_ACTION_LED_YELLOW_OFF
Turn Red LED onRMD_ATTR_VALUE_ACTION_LED_RED_ON
Turn Red LED offRMD_ATTR_VALUE_ACTION_LED_RED_OFF
The following code example demonstrates how to command the scanner's LED to illuminate green.
Code Snippet - LED Control
LED Attribute Values
DescriptionAttribute Value
// ....
#import "RMDAttributes.h"
// ....
// Specify the ID of the scanner to control
int scannerID = 1;
// Specify the scanner ID and attribute value the LED command in the XML
// 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
NSLog(@"Successfully enabled scanning on scanner ID %d",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to enable scanning on scanner ID %d",scannerId);
}
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.
Code Snippet - Disable Scanning Capability
// ....
// Create XML string to disable scanning on scanner ID 3
NSString *xmlInput = [NSString stringWithFormat:@"
// 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
NSLog(@"Successfully disabled scanning on scanner ID %d",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to disable scanning on scanner ID %d",scannerId);
}
SAMPLE SOURCE CODE3 - 15
Symbologies
Get Supported Symbology IDs
The get all symbologies command (SBT_RSM_ATTR_GETALL) is used to retrieve the scanner's support
symbologies. The supported symbology attribute values are returned from the scanner as an XML formatted
string. Table 3-6 includes valid symbology attribute values.
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process xml string containing supported symbologies
NSLog(@"Supported symbologies from scanner ID %d:
%@",scannerId,xmlResponse);
}
else
{
// TODO: Process error
NSLog(@"Failed to retrieve supported symbologies from scanner ID
%d",scannerId);
}
SAMPLE SOURCE CODE3 - 17
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.
Code Snippet - Retrieve Symbology Value
// ....
// Create XML string to request value of supported symbology ID's 1 and 8 for
scanner ID 3
// 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
NSLog(@"Supported symbology values from scanner ID %d:
%@",scannerId,xmlResponse);
}
else
{
// TODO: Process error
NSLog(@"Failed to retrieve symbology values from scanner ID %d",scannerId);
}
3 - 18Zebra Scanner SDK for iOS Developer Guide
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.
Code Snippet - Set Symbology Value
// ....
int scannerId = 3;
int symbologyId = 8;
// Create XML string to set value of symbology ID 8 for scanner ID 3 to "True"
NSString *xmlInput = [NSString stringWithFormat:@"
// 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
NSLog(@"Successfully updated symbology value for scanner ID %d:
%@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to set symbology value for scanner ID %d",scannerId);
}
SAMPLE SOURCE CODE3 - 19
Trigger
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.
Code Snippet - Pull Trigger
// ....
// Create XML string to 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
NSLog(@"Successfully pulled trigger on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to pull trigger on scanner ID %d",scannerId);
}
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.
Code Snippet - Release Trigger
// ....
// Create XML string to command scanner ID 3 to release 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
NSLog(@"Successfully released trigger on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to release trigger on scanner ID %d",scannerId);
}
3 - 20Zebra Scanner SDK for iOS Developer Guide
AIM
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.
Code Snippet - AIM On
// ....
// Create XML string to command scanner ID 3 to AIM on
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_AIM_ON
aInXML:xmlInput aOutXML:nil forScanner:3];
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process successful operation
NSLog(@"Successfully Aim ON on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to Aim ON on scanner ID %d",scannerId);
}
Aim Off
The aim off command (SBT_DEVICE_AIM_OFF) is used to AIM on. The following code example demonstrates
how to command the scanner's trigger to be released.
Code Snippet - Aim Off
// ....
// Create XML string to command scanner ID 3 to AIM off
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_AIM_OFF
aInXML:xmlInput aOutXML:nil forScanner:3];
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process successful operation
NSLog(@"Successfully AIM off on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to AIM off on scanner ID %d",scannerId);
}
SAMPLE SOURCE CODE3 - 21
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.
Code Snippet - Page Motor Function
// ....
// Create XML string to command scanner ID 3 to activate page motor.
SBT_RESULT result = [apiInstance
sbtExecuteCommand:SBT_DEVICE_VIBRATION_FEEDBACK aInXML:xmlInput aOutXML:nil
forScanner:3];
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process successful operation
NSLog(@"Successfully activated page motor scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to activate page motor on scanner ID %d",scannerId);
}
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.
Code Snippet - Update Firmware with Dat File
// ....
// Create XML string to command scanner ID 3 to update firmware
//selectedFWFilePath = absolute path of the DAT file
SBT_RESULT result = [apiInstance sbtExecuteCommand:SBT_UPDATE_FIRMWARE
aInXML:xmlInput aOutXML:nil forScanner:3];
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process successful operation
NSLog(@"Successfully pulled updated firmware on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to update firmware on scanner ID %d",scannerId);
}
3 - 22Zebra Scanner SDK for iOS Developer Guide
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.
Code Snippet - Update Firmware with Plug-in File
// ....
// Create XML string to command scanner ID 3 to update firmware by plugin
//selectedFWFilePath = absolute path of the plugin file
NSString *in_xml = [NSString
if (result == SBT_RESULT_SUCCESS)
{
// TODO: Process successful operation
NSLog(@"Successfully updated firmware on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to update firmware on scanner ID %d",scannerId);
Abort Firmware Update
The abort firmware update command (SBT_DEVICE_ABORT_UPDATE_FIRMWARE) is used to abort ongoing
firmware update.
Code Snippet - Update Firmware Update
// ....
// Create XML string to command scanner ID 3 to update abort fw update
//
NSString *in_xml = [NSString
{
// TODO: Process successful operation
NSLog(@"Successfully aborted firmware on scanner ID %d: %@",scannerId);
}
else
{
// TODO: Process error
NSLog(@"Failed to abort firmware on scanner ID %d",scannerId);
Chapter 4ZEBRA SCANNER SDK for iOS
API
Introduction
This chapter defines the API that can be used by external applications to connect remote scanners to a
specific iOS device and control connected scanners.
4 - 2Zebra Scanner SDK for iOS Developer Guide
Application Programming Interface Definition
This section describes constants, types, functions, and notifications which are used in the Zebra Scanner SDK
for iOS API.
Constants
Result Codes
These constants are defined to represent result codes that can be returned by SDK API functions.
Table 4-1
SBT_RESULT_SUCCESSA specific API function has completed successfully0
SBT_RESULT_FAILUREA specific API function has completed unsuccessfully.1
SBT_RESULT_SCANNER_NOT_AVAILABLEA specific API function has completed unsuccessfully
SBT_RESULT_SCANNER_NOT_ACTIVEA specific API function has completed unsuccessfully
SBT_RESULT_INVALID_PARAMSA specific API function has completed unsuccessfully
SBT_RESULT_RESPONSE_TIMEOUTA specific API function has completed unsuccessfully
SBT_RESULT_OPCODE_NOT_SUPPORTEDA specific API function has completed unsuccessfully
SBT_RESULT_SCANNER_NO_SUPPORTA specific API function and/or a corresponding SSI
Constants - Result Codes
Result CodeDescriptionValue
because a specified scanner was not available.
because a specified scanner was not active.
due to invalid input and/or output parameters.
due to expiration of a response timeout during
communication with a specific scanner.
due to unsupported opcode.
command are not supported by a specific model of
scanner.
2
3
4
5
6
7
Operating Modes
These constants are defined to represent operating modes of the Zebra Scanner SDK for iOS.
Table 4-2
SBT_OPMODE_MFIThe SDK is able to communicate with scanners in "iOS
SBT_OPMODE_BTLEThe SDK is able to communicate with scanners in "iOS
SBT_OPMODE_ALLThe SDK is able to communicate with scanners in "iOS
Constants - Operating Modes
Operating ModeDescriptionValue
BT MFi" mode only.
BT LE" mode only.
BT MFi" mode and with scanners in "iOS BT LE" mode.
1
2
3
ZEBRA SCANNER SDK for iOS API4 - 3
Scanner Modes
These constants are defined to represent communication modes of scanners.
Table 4-3
SBT_CONNTYPE_INVALIDThe SDK is unable to determine communication mode
SBT_CONNTYPE_MFIA specific scanner is in "iOS BT MFi" mode.1
SBT_CONNTYPE_BTLEA specific scanner is in "iOS BT LE" mode.2
Constants - Scanner Modes
Scanner ModeDescriptionValue
of a specific scanner.
Notifications
These constants are defined to represent notifications provided by Zebra Scanner SDK for iOS.
Table 4-4
SBT_EVENT_BARCODE"Barcode event" notification (reception of a specific bar
SBT_EVENT_IMAGE"Image event" notification (triggered when an imaging
SBT_EVENT_VIDEO"Video event" notification (triggered when an imaging
Constants - Notifications
NotificationDescriptionValue
code of specific type from a specific active scanner).
scanner captures images in image mode).
scanner captures video in video mode).
0
1
2
4
SBT_EVENT_SCANNER_APPEARANCE"Device Arrival" notification (appearance of an available
scanner).
SBT_EVENT_SCANNER_DISAPPEARANCE"Device Disappeared" notification (disappearance of an
available scanner).
SBT_EVENT_SESSION_ESTABLISHMENT"Session Established" notification (appearance of a
specific active scanner).
SBT_EVENT_SESSION_TERMINATION"Session Terminated" notification (disappearance of an
active scanner).
SBT_EVENT_RAW_DATA"Raw Data Received" notification (reception of raw data
from a specific active scanner in "raw data pipe" mode).
8
16
32
64
128
4 - 4Zebra Scanner SDK for iOS Developer Guide
Opcodes
These constants are defined to represent opcodes of methods supported by "Execute Command" API function.
Table 4-5
SBT_DEVICE_PULL_TRIGGEROpcode of DEVICE_PULL_TRIGGER method of the
SBT_DEVICE_RELEASE_TRIGGEROpcode of DEVICE_RELEASE_TRIGGER method of the
SBT_DEVICE_CAPTURE_IMAGEOpcode of DEVICE_CAPTURE_IMAGE method of the
SBT_DEVICE_CAPTURE_VIDEOOpcode of DEVICE_CAPTURE_VIDEO method of the
SBT_DEVICE_CAPTURE_BARCODEOpcode of DEVICE_CAPTURE_BARCODE method of the
SBT_DEVICE_SCAN_ENABLEOpcode of SCAN_ENABLE method of the "Execute
SBT_DEVICE_SCAN_DISABLEOpcode of SCAN_DISABLE method of the "Execute
SBT_SET_ACTIONOpcode of SET_ACTION method of the "Execute
Constants - Opcodes
OpcodeDescriptionValue
"Execute Command" API.
"Execute Command" API.
"Execute Command" API.
"Execute Command" API.
"Execute Command" API.
Command" API.
Command" API.
Command" API.
2011
2012
3000
4000
3500
2014
2013
6000
SBT_RSM_ATTR_GETALLOpcode of ATTR_GETALL method of the "Execute
Command" API.
SBT_RSM_ATTR_GETOpcode of ATTR_GET method of the "Execute
Command" API.
SBT_RSM_ATTR_GET_OFFSETOpcode of ATTR_GET_OFFSET method of the "Execute
Command" API.
SBT_RSM_ATTR_SETOpcode of ATTR_SET method of the "Execute
Command" API.
SBT_RSM_ATTR_STOREOpcode of ATTR_STORE method of the "Execute
Command" API.
5000
5001
5003
5004
5005
ZEBRA SCANNER SDK for iOS API4 - 5
Scanner Models
These constants are defined to represent models of scanners supported by Zebra Scanner SDK for iOS.
Table 4-6
SBT_DEVMODEL_INVALIDThe model either unknown, not recognized or not
SBT_DEVMODEL_SSI_RFD8500RFD8500 in SSI Imager mode.1
SBT_DEVMODEL_SSI_CS4070CS4070 scanner.2
SBT_DEVMODEL_SSI_GENERICGeneric SSI imager.3
SBT_DEVMODEL_RFID_RFD8500RFD8500 in RFID reader mode.4
Constants - Scanner Models
Scanner ModelDescriptionValue
supported.
LED Codes
These constants are defined to represent LED codes supported by "LED Control" API function.
These constants are defined to represent beep codes supported by "Beep Control" API function.
Table 4-8
SBT_BEEPCODE_SHORT_HIGH_1One high short beep.0
SBT_BEEPCODE_SHORT_HIGH_2Two high short beeps.1
SBT_BEEPCODE_SHORT_HIGH_3Three high short beeps.2
SBT_BEEPCODE_SHORT_HIGH_4Four high short beeps.3
SBT_BEEPCODE_SHORT_HIGH_5Five high short beeps.4
SBT_BEEPCODE_SHORT_LOW_1One low short beep.5
SBT_BEEPCODE_SHORT_LOW_2Two low short beeps.6
SBT_BEEPCODE_SHORT_LOW_3Three low short beeps.7
Constants - Beep Codes
Beep CodeDescriptionValue
SBT_BEEPCODE_SHORT_LOW_4Four low short beeps.8
4 - 6Zebra Scanner SDK for iOS Developer Guide
Table 4-8
SBT_BEEPCODE_SHORT_LOW_5Five low short beeps.9
SBT_BEEPCODE_LONG_HIGH_1One high long beep.10
SBT_BEEPCODE_LONG_HIGH_2Two high long beeps.11
SBT_BEEPCODE_LONG_HIGH_3Three high long beeps.12
SBT_BEEPCODE_LONG_HIGH_4Four high long beeps.13
SBT_BEEPCODE_LONG_HIGH_5Five high long beeps.14
SBT_BEEPCODE_LONG_LOW_1One low long beep.15
SBT_BEEPCODE_LONG_LOW_2Two low long beeps.16
SBT_BEEPCODE_LONG_LOW_3Three low long beeps.17
SBT_BEEPCODE_LONG_LOW_4Four low long beeps.18
SBT_BEEPCODE_LONG_LOW_5Five low long beeps.19
SBT_BEEPCODE_FAST_WARBLEFast warble beep.20
SBT_BEEPCODE_SLOW_WARBLESlow warble beep.21
int m_ScannerID;
int m_ConnectionType;
BOOL m_AutoCommunicationSessionReestablishment;
BOOL m_Active;
BOOL m_Available;
NSString *m_ScannerName;
int m_ScannerModel;
See Functions on page 4-10 for the descriptions of API functions.
SbtSdkFactory
Used to create and access a single shared instance of an API object. API object implements ISbtSdkApi
protocol and is used to perform specific API calls.
@interface SbtSdkFactory : NSObject
+(id<ISbtSdkApi>) createSbtSdkApiInstance;
@end
Table 4-10
SbtScannerInfo Variable Descriptions
NameDescription
+(id<ISbtSdkApi>)createSbtSdkApiInstanceClass method, returns a single shared instance
of an object which conforms to ISbtSdkApi
protocol and should be used to perform specific
API calls.
ISbtSdkApiDelegate
Objective C protocol which defines the SDK callbacks interface. Registration of a specific object which
conforms to the ISbtSdkApiDelegate protocol is required to receive particular from the SDK.
API functions are defined by ISbtSdkApi Objective C protocol. A specific object which implements the
protocol is accessible via createSbtSdkApiInstance method of SbtSdkFactory class. See ISbtSdkApi
on page 4-8 and SbtSdkFactory on page 4-9 for details.
sbtGetVersion
Description
Returns version of the SDK.
- (NSString*) sbtGetVersion;
Parameters
None.
Return Values
SDK version as NSString autoreleased object.
ZEBRA SCANNER SDK for iOS API4 - 11
sbtSetDelegate
Description
Registers a specific object which conforms to ISbtSdkApiDelegate Objective C protocol as a receiver
of SDK notifications. Registration of a specific object which conforms to ISbtSdkApiDelegate protocol
is required to receive notifications from the SDK.
The requested operating mode of the SDK was configured successfully.
SBT_RESULT_FAILURE
Invalid parameters.
NOTES If operating mode of the SDK is not configured intentionally, the SDK remains disabled and is not able to
communicate with scanners in either "iOS BT MFi" or "iOS BT LE" mode.
Selection of a new operating mode results in:
•
Disconnection of active incompatible scanners (e.g., "iOS BT LE" scanners in SBT_OPMODE_MFI
mode), removing available incompatible scanners and providing corresponding notifications if these
notifications are enabled.
•
Performing discovery of available scanners compatible with requested operating mode (if "Available
scanners detection" option is enabled) and providing corresponding notifications if these notifications are
enabled.
4 - 12Zebra Scanner SDK for iOS Developer Guide
sbtSubsribeForEvents
Description
Enables providing of notification of requested types.
[in] Whether the option should be enabled or disabled:
YES
Requests to enable "Available scanners detection" option.
NO
Requests to disable "Available scanners detection" option.
Return Values
SBT_RESULT_SUCCESS
"Available scanners detection" option was enabled/disabled successfully.
NOTES
•
The SDK performs a discovery of available scanners once the option is enabled and provides
corresponding notifications if the notifications are enabled.
•
If the option is enabled, the SDK detects connection and disconnection of scanners operating in "iOS BT
MFi" mode in both foreground and background execution modes of a specific application linked with the
SDK and provides corresponding notifications if the notifications are enabled.
•
If the option is enabled the SDK detects appearance and disappearance of scanners operating in "iOS BT
LE" mode in only foreground execution mode of a specific application linked with the SDK through
periodic discovery operation and provides corresponding notifications if the notifications are enabled.
ZEBRA SCANNER SDK for iOS API4 - 15
sbtEnableAutomaticSessionReestablishment
Description
Requests to enable/disable "Automatic communication session reestablishment" option for a specific
[in] Unique identifier of a specific scanner assigned by SDK.
(BOOL)enable
[in] Whether the option should be enabled or disabled:
YES
Requests to enable "Automatic communication session reestablishment" option.
NO
Requests to disable "Automatic communication session reestablishment" option.
Return Values
SBT_RESULT_SUCCESS
"Automatic communication session reestablishment" option was enabled/disabled successfully.
SBT_RESULT_FAILURE
The specified scanner was not found.
NOTES
•
If the option is enabled for a specific scanner the SDK automatically establishes a
communication session in "SSI" mode with this scanner once the scanner is recognized as
available:
•
The scanner can be recognized as available automatically by the SDK if the "Available
scanners detection" option is enabled.
•
The scanner can be recognized as available during discovery procedure requested by the
sbtGetAvailableScannersList API.
•
"Session Established" notification is provided once the communication session is established if
this type of notification is enabled.
4 - 16Zebra Scanner SDK for iOS Developer Guide
sbtExecuteCommand
Description
Provides synchronous execution of a specific method via an opcode. See Methods of the "Execute
Command" API on page 4-23 for description of specific methods.
sbtExecuteCommand function instead to perform a beeper
Parameters
(BARCODE_TYPE)barcodeType
[in] Type of the bar code.
(STC_COM_PROTOCOL)comProtocol
[in] Communication protocol.
(SETDEFAULT_STATUS)setDefaultsStatus
[in] Set default status.
(NSString*)btAddress
[in] Bluetooth address.
(CGRect)imageFrame
[in] Bluetooth address.
Return Value
UIImage
Image of the generated STC bar code.
4 - 20Zebra Scanner SDK for iOS Developer Guide
Notifications
The SDK callback interface is defined by ISbtSdkApiDelegate Objective C protocol. Registration of a
specific object which conforms to ISbtSdkApiDelegate protocol is required to receive specific notifications
from Zebra Scanner SDK for iOS.
sbtEventScannerAppeared
Description
"Device Arrival" notification informs about appearance of a specific available scanner.
NSString object representing raw data of the scanned bar code.
(int)barcodeType
Bar code type of the scanned bar code. Values of bar code data types are available in the Zebra
Scanner SDK For Windows Developer Guide (p/n 72E-149784-XX).
(int)scannerID
Unique identifier of a specific active scanner assigned by SDK.
sbtEventBarcodeData function instead (see
NOTE The SDK is responsible for allocation and deallocation of barcodeData object. The SDK deallocates
barcodeData object immediately after execution of the callback.
the
sbtEventBarcodeData
Description
"Barcode Event" notification informs about reception of a particular barcode of a particular type from a
NSData object representing raw data byte of the scanned bar code.
(int)barcodeType
Bar code type of the scanned bar code. Values of bar code data types are available in the Zebra
Scanner SDK For Windows Developer Guide (p/n 72E-149784-XX).
(int)scannerID
Unique identifier of a particular active scanner assigned by SDK.
NOTE - Use this function instead of sbtEventBarcode.
4 - 22Zebra Scanner SDK for iOS Developer Guide
sbtEventImage
Description
"Image Event" notification is triggered when an active imaging scanner captures images in image mode.
FirmwareUpdateEvent object representing current status of firmware update.
NOTE No need to specifically subscribe to this event.
ZEBRA SCANNER SDK for iOS API4 - 23
Methods of the "Execute Command" API
The described methods are invoked through the "Execute Command" API. See sbtExecuteCommand on page
4-16t for details. The execution of most of the described methods results in communicating with a specific
active scanner via SSI and RMD protocols. Refer to the Simple Serial Interface Version 2.0 Internal
Specification and RMD protocol specification for details.
DEVICE_PULL_TRIGGER
Pull the trigger of a specified active scanner.
Opcode
SBT_DEVICE_PULL_TRIGGER
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending START_SESSION SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
DEVICE_RELEASE_TRIGGER
Release the pulled trigger of a specified active scanner.
Opcode
SBT_DEVICE_RELEASE_TRIGGER
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending STOP_SESSION SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
4 - 24Zebra Scanner SDK for iOS Developer Guide
SCAN_DISABLE
Disable scanning of a specified active scanner.
Opcode
SBT_DEVICE_SCAN_DISABLE
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending SCAN_DISABLE SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
SCAN_ENABLE
Enable scanning on a specified active scanner.
Opcode
SBT_DEVICE_SCAN_ENABLE
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending SCAN_ENABLE SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
ZEBRA SCANNER SDK for iOS API4 - 25
DEVICE_CAPTURE_BARCODE
Change a specified active scanner to decode mode.
Opcode
SBT_DEVICE_CAPTURE_BARCODE
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending IMAGER_MODE SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
DEVICE_CAPTURE_IMAGE
Change a specified active scanner to snapshot mode.
Opcode
SBT_DEVICE_CAPTURE_IMAGE
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending IMAGER_MODE SSI protocol command.
•
The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
4 - 26Zebra Scanner SDK for iOS Developer Guide
DEVICE_CAPTURE_VIDEO
Change a specified active scanner to video mode.
Opcode
SBT_DEVICE_CAPTURE_VIDEO
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending IMAGER_MODE SSI protocol command.
•
- The method is supposed to be executed successfully if CMD_ACK is received from a scanner.
SET_ACTION
Perform an action involving the scanner's beeper or LEDs. Values for the SET_ACTION method are available
in the Zebra Scanner SDK Attribute Dictionary (p/n 72E-149786-XX).
Execution of the method results in sending ATTRIBUTE_SET RMD protocol command via
SSI_MGMT_COMMAND SSI protocol command in order to set a required value of "Beeper/LED" attribute.
•
The method is supposed to be executed successfully if ATTRIBUTE_SET RMD protocol command for
"Beeper/LED" attribute was sent to a scanner and a corresponding response for the issued
ATTRIBUTE_SET RMD command is received via SSI_MGMT_COMMAND SSI packets from a scanner.
ZEBRA SCANNER SDK for iOS API4 - 27
ATTR_GETALL
Get all attributes of a specified active scanner. Refer to the Zebra Scanner SDK Attribute Dictionary
(p/n 72E-149786-XX) for attribute numbers, types and possible values.
Opcode
SBT_RSM_ATTR_GETALL
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
</inArgs>
Execution of the method results in sending ATTRIBUTE_GETALL RMD protocol command(s) via
SSI_MGMT_COMMAND SSI protocol command.
•
The method is supposed to be executed successfully if a set of ATTRIBUTE_GETALL RMD responses
are received via
that the end of the attribute table was reached.
SSI_MGMT_COMMAND packets from a scanner and the last response packet indicates
4 - 28Zebra Scanner SDK for iOS Developer Guide
ATTR_GET
Query the values of attribute(s) of a specified active scanner. Refer to the Zebra Scanner SDK Attribute
Dictionary (p/n 72E-149786-XX) for attribute numbers, types and possible values.
Execution of the method results in sending ATTRIBUTE_GET RMD protocol command(s) via
SSI_MGMT_COMMAND SSI protocol command.
•
The method should be executed successfully if all required attributes are requested from a scanner
through a set of
RMD commands are received via
•
The successful execution of the method does not guarantee that all requested attributes are received
from a scanner if some of requested attributes are not supported by a specific scanner.
•
The method supports the query of maximum 100 attributes values. If more than 100 attribute values are
requested, the "Execute Command" API returns
input parameters are not valid.
ATTRIBUTE_GET RMD commands and responses for all issued ATTRIBUTE_GET
SSI_MGMT_COMMAND SSI packets from a scanner.
SBT_RESULT_INVALID_PARAMS to indicate that
4 - 30Zebra Scanner SDK for iOS Developer Guide
ATTR_GET_OFFSET
Query the value of an attribute of a specified active scanner. The method provides the ability to retrieve
string/array attribute values that do not fit within a single RMD protocol packet. It is the responsibility of the
application to determine what the starting offset is. Refer to the Zebra Scanner SDK Attribute Dictionary
(p/n 72E-149786-XX) for attribute numbers, types, and possible values.
Opcode
SBT_RSM_ATTR_GET_OFFSET
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
<cmdArgs>
<arg-xml>
<attribute>
<id>6002</id>? Attribute Number
<offset>200</offset>? Starting Offset
</attribute>
</arg-xml>
</cmdArgs>
</inArgs>
outXML
<?xml version="1.0" encoding="UTF-8"?>
<outArgs>
<scannerID>1</scannerID>? Scanner ID of Data Receiving
<arg-xml>
<modelnumber>DS670-SR20001ZZR</modelnumber>
<serialnumber>7116000501003</serialnumber>
<response>
<opcode>5003</opcode>? Method Response Received
<attrib_list>
<attribute>
<id>6002</id>? Attribute Number
<name></name>
<datatype>A</datatype>? Attribute Data Type
<permission>R</permission>? Permissions of the Attribute
<length>3936</length>? Total Length of Value
<offset>200</offset>? Starting Offset
<value_length>227</value_length>? Length of Received Value
<value>? Received Attribute Value
Execution of the method results in sending one ATTRIBUTE_GET_OFFSET RMD protocol command
SSI_MGMT_COMMAND SSI protocol command.
via
•
The method is supposed to be executed successfully if a required attribute is requested from a scanner
through
ATTRIBUTE_GET_OFFSET RMD command is received via SSI_MGMT_COMMAND SSI packet from a
scanner.
ATTRIBUTE_GET_OFFSET RMD command and a response for an issued
ATTR_SET
Set the values of the attribute(s) of a specified scanner. The attribute(s) set using this method is lost after the
next power down. Refer to the Zebra Scanner SDK Attribute Dictionary (p/n 72E-149786-XX) for attribute
numbers, types and possible values.
Opcode
SBT_RSM_ATTR_SET
(continued on next page)
4 - 32Zebra Scanner SDK for iOS Developer Guide
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
<cmdArgs>
<arg-xml>
<attrib_list>
<attribute>
<id>1</id>? Attribute Number
<datatype>F</datatype>? Attribute Data Type
<value>False</value>? Attribute Value
</attribute>
<attribute>
<id>2</id>? Attribute Number
<datatype>S</datatype>? Attribute Data Type
<value>Symbol</value>? Attribute Value
</attribute>
</attrib_list>
</arg-xml>
</cmdArgs>
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending ATTRIBUTE_SET RMD protocol command(s) via
SSI_MGMT_COMMAND SSI protocol command.
•
The method is supposed to be executed successfully if ATTRIBUTE_SET RMD protocol commands for
all required attributes were sent to a scanner and responses for all issued
commands are received via
•
The method supports setting of maximum 100 attributes values. If more than 100 attribute values are
requested to be set, the "Execute Command" API returns
indicate that input parameters are not valid.
SSI_MGMT_COMMAND SSI packets from a scanner.
SBT_RESULT_INVALID_PARAMS to
ATTRIBUTE_SET RMD
ZEBRA SCANNER SDK for iOS API4 - 33
ATTR_STORE
Store the values of attribute(s) of a specified scanner. Attribute(s) store using this method are persistent over
power down and power up cycles. Refer to the Zebra Scanner SDK Attribute Dictionary (p/n 72E-149786-XX)
for attribute numbers, types and possible values.
Opcode
SBT_RSM_ATTR_STORE
inXML
<inArgs>
<scannerID>1</scannerID>? Specified Scanner ID
<cmdArgs>
<arg-xml>
<attrib_list>
<attribute>
<id>1</id>? Attribute Number
<datatype>F</datatype>? Attribute Data Type
<value>False</value>? Attribute Value
</attribute>
<attribute>
<id>2</id>? Attribute Number
<datatype>S</datatype>? Attribute Data Type
<value>Symbol</value>? Attribute Value
</attribute>
</attrib_list>
</arg-xml>
</cmdArgs>
</inArgs>
outXML
Not used.
NOTES
•
Execution of the method results in sending ATTRIBUTE_STORE RMD protocol command(s) via
SSI_MGMT_COMMAND SSI protocol command.
•
The method should execute successfully if ATTRIBUTE_STORE RMD protocol commands for all
required attributes were sent to a scanner and responses for all issued
commands are received via
•
The method supports storing of maximum 100 attributes values. If more than 100 attribute values are
requested to be stored, the "Execute Command" API returns