Scanner SDK API

Overview

The Zebra Scanner SDK provides an easy to use yet powerful and extendible set of API commands to interface with scanner devices. The API commands include:

  • Open
  • GetScanners
  • ExecCommand
  • ExecCommandAsync
  • Close

Once the SDKs Open and GetScanners commands are invoked and the list of connected scanners is retrieved, all other methods execute through the ExecCommand and ExecCommandAsync commands. This is a user friendly approach, and easy to code in terms of day-to-day programming.

With the evolution of the SDK's capabilities, it is easier to increase the number of methods rather than increase the number of API commands. The benefit to the user is that, once you have the system up and running, a new method is just an additional operation to the existing code.

In addition to the commands above, the Zebra Scanner SDK supports seven types of events:

  • ImageEvent
  • VideoEvent
  • BarcodeEvent
  • PNPEvent
  • ScanRMDEvent
  • CommandResponseEvent
  • IOEvent

See sample source code for an example of an application illustrating the Zebra Scanner SDK.

NOTE For a list of a scanner's supported attribute (parameter) numbers and definitions, refer to the Product Reference Guide for that model scanner, available from the Zebra Support website at http://www.zebra.com/support. Attributes include configuration parameters, monitored data, and asset tracking information.

References


Scanner ID

In the SDK context, scanner ID uniquely identifies a scanner device connected to the CoreScanner driver, and is required to communicate programmatically with the device. Developers need to call the GetScanners method of the CoreScanner API in order to retrieve the scanner IDs of connected devices. For example, to switch on a scanner's red LED, the scanner ID of that particular scanner must be obtained to provide that value in the <scannerID> element of inXML of the ExecCommand method call.

During each CoreScanner driver instance, scanner IDs are sequentially assigned to each connected device. When the CoreScanner driver is restarted, the array of connected scanners is reinitialized and previous scanner IDs may no longer be valid. In this case, the GetScanners method must be executed to obtain the new scanner IDs.

During a single CoreScanner driver instance, an RSM (Remote Scanner Management) supported scanner that is unplugged, and reconnected retaina its unique scanner ID. However, a non-RSM device is assigned a different scanner ID each time it is reconnected.


API Commands

Open

Opens an application instance from the user application or user library. This must be the first API command called before invoking any other API command from the user level application.

Syntax


unsigned short Open(
    /* [in] */ IEventListenerXml* pEventListener,
    /* [in] */ unsigned int scannerTypeFlags,
    /* [out]*/ StatusID *status);

Parameters

pEventListener - Input argument of IEventListener class type object reference.

scannerTypeFlags - The types of scanners requested for use with the API. Use "|" to specify multiple types.

Table 1: Values for scannerTypeFlags

Code Value Scanner Category
SCANNER_TYPES_ALL 0 All Scanners
SCANNER_TYPES_SNAPI 1 SNAPI Scanners
SCANNER_TYPES_IBMHID 2 IBM Hand Held Scanners (USB OPOS)
SCANNER_TYPES_IBMTT 4 IBM Table-top Scanners
SCANNER_TYPES_HIDKB 8 USB HID Keyboard scanners

Return Values

0 - Success.

Any other value - See Error and Status Codes on Appendix.

GetScanners

Gets a list of connected scanners of the requested types. Invoke this command after the Open command.

Syntax


unsigned short GetScanners(
    /* [out] */ unsigned short *numberOfScanners,
    /* [out][in] */ std::vector<unsigned int> *scannerIDList,
    /* [out] */ std::string& outXML,
    /* [out] */ StatusID *status);

Parameters

numberOfScanners - Number of connected scanners of requested type(s).

sfScannerIDList - Vector/Array of scannerIDs of the requested type(s). The size of the array is 255 (MAX_NUM_DEVICES).

outXML - XML string scanner meta information.

status - Return value for the command.

Return Values

0 - Success.

Any other value - See Error and Status Codes on Appendix.

ExecCommand

Provides synchronous execution of a method via an opcode.

Syntax


unsigned short ExecCommand(
    /* [in] */ unsigned int opcode,
    /* [in] */const std::string inXML,
    /* [out] */ std::string& outXML,
    /* [out] */ StatusID *status);

Parameters

opcode - Method to execute. See Methods Invoked Through ExecCommand Or ExecCommandAsync for opcodes.

inXML - Relevant argument list for the opcode, structured into an XML string.

outXML - XML string, scanner meta information.

status - Return value for the command.

Return Values

0 - Success.

Any other value - See Error and Status Codes on Appendix.

ExecCommandAsync

Provides asynchronous execution of a method via an opcode. Any response data is retrieved as a ScannerNotificationEvent.

Syntax


unsigned short ExecCommandAsync(
    /* [in] */ unsigned int opcode,
    /* [in] */ const std::string inXML,
    /* [out] */ StatusID *status);        

Parameters

opcode - Method to execute. See Methods Invoked Through ExecCommand Or ExecCommandAsync for opcodes.

inXML - Relevant argument list for the opcode, structured into an XML string.

status - Return value for the command.

Return Values

0 - Success.

Any other value - See Error and Status Codes on Appendix.

Close

Closes the application instance through the CoreScanner service.

Syntax


unsigned short Close(
    /* [in] */ unsigned int appHandle,
    /* [out] */ StatusID *status);

Parameters

appHandle - Reserved argument. Set to 0.

status - Return value for the command.

Return Values

0 - Success.

Any other value - See Error and Status Codes on Appendix.


API Events

The user application must register for each event category separately to receive events for that category. Use the methods REGISTER_FOR_EVENTS and UNREGISTER_FOR_EVENTS for this purpose (see Table 2 on Appendix).

ImageEvent

Triggered when an imaging scanner captures images in image mode. To receive ImageEvents, an application needs to execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_IMAGE event type.

Syntax


void OnImageEvent(
    short eventType, 
    int size,
    short imageFormat, 
    char* sfimageData, 
    int dataLength,
    std::string& pScannerData )    

Parameters

eventType - Type of image event received (see Table 2).

Table 2: Image Event Types

Event Type Value Description
IMAGE_COMPLETE 1 Triggered when complete image captured
IMAGE_TRAN_STATUS 2 Triggered when image error or status

size - Size of image data buffer.

dataLength - Length of image data buffer.

imageFormat - Format of image. (see Table 3)

Table 3: Image Formats

Event Type Value
JPEG_FILE_SELECTION 1
BMP_FILE_SELECTION 3
TIFF_FILE_SELECTION 4

sfimageData - Image data buffer.

pScannerData - Information in XML format about the scanner (ID, Model Number, Serial Number and GUID) that triggered the image event.


<?xml version="1.0" encoding="UTF-8"?>
<outArgs>
    <scannerID>1</scannerID>
    <arg-xml>
        <modelnumber>DS6707-SR20001ZZR</modelnumber>
        <serialnumber>7114000503322</serialnumber>
        <GUID>33C01F39EB23D949B5F3DBF643304FC4</GUID>
    </arg-xml>
</outArgs>

VideoEvent

Triggered when an imaging scanner captures video in video mode. To receive VideoEvents, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_VIDEO event type.

Syntax


void OnVideoEvent(
    short eventType,
    int size,
    char* sfvideoData, 
    int dataLength,
    std::string& pScannerData)

Parameters

eventType - Type of video event received. (see Table 4)

Table 4: Video Event Types

Event Type Value Description
VIDEO_FRAME_COMPLETE 1 A complete video frame is captured.

size - Size of video data buffer.

sfvideoData - Video data buffer.

dataLength - Length of video data buffer.

pScannerData - Reserved parameter. Always returns an empty string.

BarcodeEvent

Triggered when a scanner captures barcodes. To receive BarcodeEvents, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_BARCODE event type.

Syntax


void OnBarcodeEvent(
    short int eventType, 
    std::string & pscanData)

Parameters

eventType - Type of barcode event received. (see Table 5)

Table 5: Barcode Event Types

Event Type Value Description
SCANNER_DECODE_GOOD 1 A decode is successful.

pscanData - Barcode string that contains information about the scanner that triggered the barcode event including data type, data label, and raw data of the scanned barcode.


<?xml version="1.0" encoding="UTF-8"?>
<outArgs>
    <scannerID>1</scannerID>
    <arg-xml>
        <scandata>
            <modelnumber>DS6707-SR20001ZZR</modelnumber>
            <serialnumber>7114000503322</serialnumber>
            <GUID>33C01F39EB23D949B5F3DBF643304FC4</GUID>
            <datatype>8</datatype>
            <datalabel>0x30 0x32 0x31 0x38 0x39 0x38 0x36 0x32</datalabel>
            <rawdata>0x30 0x32 0x31 0x38 0x39 0x38 0x36 0x32</rawdata>
        </scandata>
    </arg-xml>
</outArgs>                                                            

<datatype> indicates the barcode type of the scanned barcode.

Barcode Data Types in Appendix lists the values received in SNAPI and IBM Hand-held USB communication protocols for each supported barcode type.

PNPEvent

Triggered when a scanner of a requested type attaches to or detaches from the system. Pairing a Bluetooth scanner to a cradle does not trigger a PnP event. To receive information about a newly paired device, call the GetScanners command again.

To receive PnPEvents, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_PNP event type.

Syntax


void OnPNPEvent( 
    short eventType, 
    std::string ppnpData)

Parameters

eventType - Type of PnP event received. (see Table 6)

Table 6: Barcode Event Types

Event Type Value Description
SCANNER_ATTACHED 0 A Zebra scanner is attached.
SCANNER_DETACHED 1 A Zebra scanner is detached.

ppnpData - PnP information string containing the asset tracking information of the attached or detached device.

Samples

Sample ppnpData XML for attachment of a direct scanner:



<outArgs>
    <arg-xml>
        <scanners>
            <scanner type="SNAPI">
                <scannerID>1</scannerID>
                <modelnumber>DS9808-SR00007C1WR</modelnumber>
                <serialnumber>1026300507698  </serialnumber>
                <GUID>77E48FC31C75444B90BE318FECFAE867</GUID>
            </scanner>
        </scanners>
        <status>1</status>
    </arg-xml>
</outArgs> 

Sample ppnpData XML for attachment of a cascaded scanner. This XML can be received as a PnP event after a GetScanners command if there are devices newly paired to a Bluetooth cradle.



<outArgs>
    <arg-xml> 
        <scanners>
            <scanner type="USBIBMHID">
                <scannerID>1</scannerID>
                <modelnumber>CR0078-SC10007WR </modelnumber>
                <serialnumber>1020800512980  </serialnumber>
                <GUID>3665579766A9514DAAF523D35E051674</GUID>
                <pnp>0</pnp>
                <scanner type="USBIBMHID">
                    <scannerID>2</scannerID>
                    <modelnumber>DS6878-SR20007WR </modelnumber>
                    <serialnumber>M1M87R38Y      </serialnumber>
                    <GUID></GUID>
                    <pnp>1</pnp>
                </scanner>
            </scanner>
        </scanners>
        <status>1</status>
    </arg-xml>
</outArgs>                                                            

ScanRMDEvent

Receives RMD events when updating scanner firmware. To receive RMD events, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_RMD event type.

Syntax


void OnScanRMDEvent(
    short eventType, 
    std::string & pscanData)

Parameters

eventType - Type of RMD event received. (see Table 7)

Table 7: RMD Event Types

Event Type Value Description
SCANNER_UF_SESS_START 11 Flash download session started.
SCANNER_UF_DL_START 12 Component download started.
SCANNER_UF_DL_PROGRESS 13 Block(s) of flash completed.
SCANNER_UF_DL_END 14 Component download ended.
SCANNER_UF_SESS_END 15 Flash download session ended.
SCANNER_UF_STATUS 16 Updated error or status.

prmdData - ScanRMD information string containing the event data.

ScannerNotificationEvent

Received when a SNAPI scanner changes operational mode. To receive ScannerNotificationEvents, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_OTHER event type.

Syntax


void OnScannerNotification(
    short notificationType, 
    std::string & pScannerData)

Parameters

notificationType - Type of the notification event received. (see Table 8)

Table 8: Notification Event Types

Event Type Value Description
DECODE_MODE 1 Triggered when a scanner changes its operation mode to decode.
SNAPSHOT_MODE 2 Triggered when a scanner changes its operation mode to image mode.
VIDEO_MODE 3 Triggered when a scanner changes its operation mode to video mode.

pScannerData - Information about the scanner (ID, Model Number, Serial Number and GUID) that triggered the notification event.

BinaryDataEvent

Triggered when an IDC-supported imaging scanner captures an image in Intelligent Document Capture (IDC). To receive a BinaryDataEvent, an application must execute the REGISTER_FOR_EVENTS method with the SUBSCRIBE_IMAGE event type.

Syntax


void OnBinaryDataEvent(
    short eventType,
    int size,
    short dataFormat,
    unsigned char* sfBinaryData,
    std::string& pScannerData)

Parameters

eventType - Reserved.

size - Size of binary data buffer.

dataFormat - The format of the BinaryDataEvent. (see Table 9)

Table 9: Binary Data Formats

Data Format
0xB5 IDC Format

sfBinaryData - Binary data buffer.

pScannerData - Information in XML format about the scanner (ID, Model Number, Serial Number, and GUID) that triggered the Binary data event.


<?xml version="1.0" encoding="UTF-8"?>
<outArgs>
    <scannerID>1</scannerID>
        <arg-xml>
        <modelnumber>DS6707-SR20001ZZR</modelnumber>
        <serialnumber>7114000503322</serialnumber>
        <GUID>33C01F39EB23D949B5F3DBF643304FC4</GUID>
    </arg-xml>
</outArgs>                                                             


Using the Methods (Examples)

NOTE The inXML segments that follow are only examples. The inXML strings must be customized by the programmer based on each user's requirements.
REGISTER_FOR_EVENTS (Value 1001)
Description Register for API events.
Asynchronous supported No
Supported Scanner Communication Protocols N/A
InXml

<inArgs>
    <cmdArgs>
        <arg-int>6</arg-int> <!-- Number of events -->
        <arg-int>1,2,4,8,16,32</arg-int> <!-- Event ID(s) -->
    </cmdArgs>
</inArgs>

Table 10 lists the Event IDs for the inXML code above.

Table 10: Event IDs

Event Name Event ID
SUBSCRIBE_BARCODE 1
SUBSCRIBE_IMAGE 2
SUBSCRIBE_VIDEO 4
SUBSCRIBE_RMD 8
SUBSCRIBE_PNP 16
SUBSCRIBE_OTHER 32

OutXml

null

UNREGISTER_FOR_EVENTS (Value 1002)
Description Unregister from API events.
Asynchronous supported No
Supported Scanner Communication Protocols N/A
InXml

<inArgs>
    <cmdArgs>
        <arg-int>6</arg-int> <!-- Number of events -->
        <arg-int>1,2,4,8,16,32</arg-int> <!-- Event ID(s) -->
    </cmdArgs>
</inArgs>       

OutXml

null

CLAIM_DEVICE (Value 1500)
Description Claim a specified device.
Asynchronous supported No
Supported Scanner Communication Protocols N/A
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

RELEASE_DEVICE (Value 1501)
Description Release a specified device.
Asynchronous supported No
Supported Scanner Communication Protocols N/A
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

CMD_LOAD_CONFIGURATION (5020)
Description Pushes the Configuration File to the Scanner.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID>
    <cmdArgs>
        <arg-string>/home/zebra/a/Config_File_DS8108_Sample_2020.09.16.scncfg</arg-string>
    </cmdArgs>
</inArgs>    

OutXml

null

ABORT_MACROPDF (Value 2000)
Description Abort MacroPDF of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

ABORT_UPDATE_FIRMWARE (Value 2001)
Description Abort firmware update process of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

AIM_OFF (Value 2002)
Description Turn off the aiming of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

AIM_ON (Value 2003)
Description Turn on the aiming of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

FLUSH_MACROPDF (Value 2005)
Description Flush MacroPDF of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

DEVICE_PULL_TRIGGER (Value 2011)
Description Pull the trigger of a specified scanner.
Asynchronous supported No
Supported Scanner Communication Protocols

SNAPI, IBM Hand-held*, IBM Table-top

*Supported auxiliary scanners if the firmware supports.

InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

DEVICE_RELEASE_TRIGGER (Value 2012)
Description Release the pulled trigger of a specified scanner.
Asynchronous supported N/A
Supported Scanner Communication Protocols

SNAPI, IBM Hand-held*, IBM Table-top

*Supported auxiliary scanners if the firmware supports.

InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

SCAN_DISABLE (Value 2013)
Description Disable scanning on a specified scanner.
Asynchronous supported N/A
Supported Scanner Communication Protocols SNAPI, IBM Hand-held, IBM Table-top
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

SCAN_ENABLE (Value 2014)
Description Enable scanning on a specified scanner.
Asynchronous supported N/A
Supported Scanner Communication Protocols SNAPI, IBM Hand-held, IBM Table-top
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

REBOOT_SCANNER (Value 2019)
Description Reboot a scanner. To reboot a Bluetooth scanner, send this command to the scanner’s associated cradle.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

DEVICE_CAPTURE_IMAGE (Value 3000)
Description Invoke snapshot mode on an imaging scanner. The scanner blinks the green LED at one second intervals to indicate it is not in standard operating (decode) mode, and reverts to standard operating mode after a trigger pull or the snapshot time out occurs. After a trigger pull, the CoreScanner driver triggers an ImageEvent containing the captured image.
Asynchronous supported N/A
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

DEVICE_CAPTURE_BARCODE (Value 3500)
Description Change a scanner to decode mode.
Asynchronous supported N/A
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

DEVICE_CAPTURE_VIDEO (Value 4000)
Description Invoke video mode on an imaging scanner. The scanner behaves as a video camera as long as the trigger is pulled. Releasing the trigger returns the scanner to decode mode. As long as the trigger is pulled, the CoreScanner driver triggers VideoEvents that contain the video data.
Asynchronous supported N/A
Supported Scanner Communication Protocols SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

ATTR_GETALL (Value 5000)
Description Get all attributes of a scanner. A synchronous call of this method returns an outXML as in the following example. An asynchronous call triggers a CommandResponseEvent.
Asynchronous supported Yes
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml


<?xml version="1.0" encoding="UTF-8" ?>
<outArgs>
    <scannerID>1</scannerID> <!-- Scanner ID of Data Receiving -->
    <arg-xml>
        <modelnumber>DS6700-SR20001ZZR</modelnumber>
        <serialnumber>7116000501003</serialnumber>
        <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID> <!-- Asset Tracking Information of the Scanner -->
        <response>
            <opcode>5000</opcode> <!-- Method Response Received -->
            <attrib_list>
                <attribute name="">0</attribute> <!-- Attribute Numbers -->
                <attribute name="">1</attribute>
                <attribute name="">2</attribute>
                <attribute name="">3</attribute>
                <attribute name="">4</attribute>
                <attribute name="">5</attribute>
                <attribute name="">6</attribute>
                <attribute name="">7</attribute>
                <attribute name="">8</attribute>
                <attribute name="">9</attribute>
                <attribute name="">10</attribute>
                <attribute name="">11</attribute>
                <attribute name="">12</attribute>
                <attribute name="">13</attribute>
                <attribute name="">14</attribute>
                <attribute name="">15</attribute>
                <attribute name="">16</attribute>
                <attribute name="">17</attribute>
                <attribute name="">18</attribute>
                <attribute name="">19</attribute>
                <attribute name="">20</attribute>
                <attribute name="">21</attribute>
                <attribute name="">22</attribute>
                <attribute name="">23</attribute>
                <attribute name="">24</attribute>
                <attribute name="">25</attribute>
                <attribute name="">26</attribute>
                <attribute name="">27</attribute>
                <attribute name="">28</attribute>
                <attribute name="">29</attribute>
                <attribute name="">30</attribute>
                <attribute name="">31</attribute>
                <attribute name="">34</attribute>
                <attribute name="">35</attribute>
                <attribute name="">36</attribute>
                <attribute name="">37</attribute>
                <attribute name="">38</attribute>
                <attribute name="">39</attribute>
                <attribute name="">655</attribute>
                <attribute name="">656</attribute>
                <attribute name="">657</attribute>
                <attribute name="">658</attribute>
                <attribute name="">659</attribute>
                <attribute name="">665</attribute>
                <attribute name="">670</attribute>
                <attribute name="">672</attribute>
                <attribute name="">673</attribute>
                <attribute name="">705</attribute>
                <attribute name="">716</attribute>
                <attribute name="">718</attribute>
                <attribute name="">721</attribute>
                <attribute name="">724</attribute>
                <attribute name="">726</attribute>
                <attribute name="">727</attribute>
                <attribute name="">728</attribute>
                <attribute name="">730</attribute>
                <attribute name="">731</attribute>
                <attribute name="">734</attribute>
                <attribute name="">735</attribute>
                <attribute name="">745</attribute>
                <attribute name="">6000</attribute>
                <attribute name="">6001</attribute>
                <attribute name="">6002</attribute>
                <attribute name="">6003</attribute>
                <attribute name="">6004</attribute>
                <attribute name="">20004</attribute>
                <attribute name="">20006</attribute>
                <attribute name="">20007</attribute>
                <attribute name="">20008</attribute>
                <attribute name="">20009</attribute>
                <attribute name="">20010</attribute>
                <attribute name="">20011</attribute>
                <attribute name="">20013</attribute>
            </attrib_list>
        </response>
    </arg-xml>
</outArgs>

NOTE Refer to the pertinent scanner's Product Reference Guide for supported attribute numbers, types, and possible values.
ATTR_GET (Value 5001)
Description Get the attribute values of a scanner. A synchronous call of this method returns outXML as in the following example. An asynchronous call triggers a CommandResponseEvent.
Asynchronous supported Yes
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-xml>
            <attrib_list>535,20004,1,140,392</attrib_list> <!-- Required Attribute Numbers -->
        </arg-xml>
    </cmdArgs>
</inArg>

OutXml


<?xml version="1.0" encoding="UTF-8" ?>
<outArgs>
    <scannerID>1</scannerID> <!-- Scanner ID of Data Receiving -->
    <arg-xml>
        <modelnumber>DS670-SR20001ZZR</modelnumber> <!-- Asset Tracking Information of the Scanner -->
        <serialnumber>7116000501003</serialnumber>
        <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
        <response> <!-- Method Response Received -->
            <opcode>5001</opcode>
            <attrib_list>
                <attribute>
                    <id>535</id>
                    <name></name>
                    <datatype>S</datatype>
                    <permission>R</permission>
                    <value>27APR07</value>
                </attribute>
                <attribute>     
                    <id>20004</id> <!-- Attribute Number -->
                    <name></name>
                    <datatype>S</datatype> <!-- Attribute Data Typer -->
                    <permission>R</permission> <!-- Permissions of the Attribute -->
                    <value>DS6707X4</value> <!-- Attribute Value -->
                </attribute>
                <attribute>
                    <id>1</id>
                    <name></name>
                    <datatype>F</datatype>
                    <permission>RWP</permission>
                    <value>True</value>
                </attribute>
                <attribute>
                    <id>140</id>
                    <name></name>
                    <datatype>B</datatype>
                    <permission>RWP</permission>
                    <value>0</value>
                </attribute>
                <attribute>
                    <id>392</id>
                    <name></name>
                    <datatype>A</datatype>
                    <permission>RWP</permission>
                    <value>0x01 0x00 0x58 0x55 0x41 0x00 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                    0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00</value>
                </attribute>
            </attrib_list>
        </response>
    </arg-xml>
</outArgs>    

ATTR_GETNEXT (Value 5002)
Description Get the value of the next attribute to a given attribute of a scanner. A synchronous call of this method returns an outXML as in the following example. An asynchronous call triggers a CommandResponseEvent.
Asynchronous supported Yes
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs> 
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-xml>
            <attrib_list>14</attrib_list> <!-- Attribute Number -->
        </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> <!-- Asset Tracking Information of the Scanner -->
        <serialnumber>7116000501003</serialnumber>
        <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
        <response> <!-- Method Response Received -->
            <opcode>5002</opcode>
            <attrib_list>
                <attribute>
                    <id>15</id> <!-- Attribute Numbers -->
                    <name></name>
                    <datatype>F</datatype> <!-- ATtribyte Data Type -->
                    <permission>RWP</permission> <!-- Permissiong on the Attribute -->
                    <value>True</value> <!-- Attribute Value -->
                </attribute>
            </attrib_list>
        </response>
    </arg-xml>
</outArgs>

ATTR_SET (Value 5004)
Description Set the attribute values of a scanner. These values are discarded on power down.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-xml>
            <attrib_list>
                <attribute>
                    <id>1</id> <!-- Attributes Nnumbers -->
                    <datatype>F</datatype> <!-- Attribute Data Type -->
                    <value>False</value> <!-- Attribute Value -->
                </attribute>
            </attrib_list>
        </arg-xml>
    </cmdArgs>
</inArgs>        

OutXml

null

ATTR_STORE (Value 5005)
Description Store the attribute values of a scanner. These values persist over power down and power up cycles.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-xml>
            <attrib_list>
                <attribute>
                    <id>1</id> <!-- Attributes Nnumbers -->
                    <datatype>F</datatype> <!-- Attribute Data Type -->
                    <value>False</value> <!-- Attribute Value -->
                </attribute>
            </attrib_list>
        </arg-xml>
    </cmdArgs>
</inArgs>  

OutXml

null

GET_DEVICE_TOPOLOGY (Value 5006)
Description Get the topology of devices connected to the calling system.
Asynchronous supported No
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs></inArgs>

OutXml


<?xml version="1.0" encoding="UTF-8"?>
<outArgs>
    <arg-xml>
        <scanners> 
            <scanner type="SNAPI"> <!-- Scanner Type -->
                <scannerID>1</scannerID>
                <modelnumber>DS670-SR20001ZZR</modelnumber>
                <serialnumber>7116000501003</serialnumber>
                <GUID>A2E647DED2163545B18BCEBD0A2A133D</GUID>
                <VID>1504</VID>
                <PID>6400</PID>
                <DoM>24MAR10</DoM>
                <firmware>NBRPUAAM</firmware>
            </scanner>
            <scanner type="USBIBMHID">
                <scannerID>2</scannerID> <!-- Asset Tracking Information of the Scanner -->
                <modelnumber>CR0078-SC10007WR</modelnumber>
                <serialnumber>MXA4WD88</serialnumber>
                <GUID>993DF345C3B00E408E8160116AE9A319</GUID>
                <VID>1504</VID>
                <PID>2080</PID>
                <DoM>24MAR10</DoM>
                <firmware>NBCACAK7</firmware>
                <scanner type="USBIBMHID"> <!-- Cascaded Scanner -->
                    <scannerID>3</scannerID>
                    <serialnumber>M1M87R39H</serialnumber>
                    <modelnumber>DS6878-SR20007WR</modelnumber>
                    <DoM>08OCT10</DoM>
                    <firmware>PAAAJS00-002-N25</firmware>
                </scanner>
            </scanner>
        </scanners>
    </outArgs>
</arg-xml>

START_NEW_FIRMWARE (Value 5014)
Description Start the updated firmware. This reboots the scanner.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
<scannerID>1</scannerID> <!-- Specified Scanner ID -->
</inArgs>

OutXml

null

UPDATE_FIRMWARE (Value 5016)
Description Update the firmware of a scanner. Specify the bulk firmware update option for faster firmware download in SNAPI mode. If an application registered for ScanRMDEvents, it receives ScanRMDEvents.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-string>D:\ScannerFW\DS6707\NBRPUCAM.DAT</arg-string> <!--  Path to the DAT File -->
        <arg-int>2</arg-int>
    </cmdArgs>
</inArgs>

OutXml

null

UPDATE_FIRMWARE_FROM_PLUGIN (Value 5017)
Description Update the firmware of a scanner using a plug-in. Specify the bulk firmware update option for faster firmware download in SNAPI mode. If an application registered for ScanRMDEvents, it receives ScanRMDEvents.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-string>D:\ScannerFW\DS9808\DS9808-COMMON SR MODELS-S-018.SCNPLG</arg-string>
        <!-- Path to the Plug-in File  -->
        <arg-int>2</arg-int>
    </cmdArgs>
</inArgs>

OutXml

null

NOTE This command does not verify supported scanner models of the plug-in. It attempts the firmware update with the DAT file extracted from the specified plug-in file regardless of model.
SET_ACTION (Value 6000)
Description Perform an action involving the scanner's beeper or LEDs.
Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-int>0</arg-int> <!-- Scanner Actions Commands -->
    </cmdArgs>
</inArgs>

OutXml

null

DEVICE_SWITCH_HOST_MODE (Value 6200)
Description

Switch the USB host mode of a scanner. This reboots the scanner. If the scanner is in HID Keyboard mode, the only supported host variants are IBM Hand-held, IBM Table-top, and SNAPI. To configure this as a silent switch (suppressing reboot beeps) and persist the targeted host mode as permanent, set the parameters in the inXML string.

For a Bluetooth scanner, send this command to the scanner's associated cradle.

Asynchronous supported N/A
Supported Scanner Communication Protocols IBM Hand-held, IBM Table-top, SNAPI, HID Keyboard.
InXml

<inArgs>
    <scannerID>1</scannerID> <!-- Specified Scanner ID -->
    <cmdArgs>
        <arg-string>XUA-45001-1</arg-string> <!-- String Code for Target Host Variant -->
        <arg-bool>TRUE</arg-bool> <!-- Silent Switch Option -->
        <arg-bool>FALSE</arg-bool> <!-- Permanent Change Option -->
    </cmdArgs>
</inArgs>

Table 11 lists the string codes for USB host variants.

Table 11: USB Host Variants

Host Variant String Code
USB-IBMHID XUA-45001-1
USB-IBMTT XUA-45001-2
USB-HIDKB XUA-45001-3
USB-SNAPI with Imaging XUA-45001-9
USB-SNAPI without Imaging XUA-45001-10
OutXml

null