WMI Scanner and Driver Sample Applications

Overview

The Zebra WMI provider includes C# sample applications that perform queries of the scanner properties and invoke methods. These sample applications, which include source code, demonstrate subscription for scanner discovery events and firmware update events.

The Driver WMI Sample Application demonstrates an application communicating with the Zebra Scanner WMI Driver. The Scanner WMI Sample Application enables you to display management data received from the scanner through the Zebra Scanner SDK Driver.


Test Utilities Provided in the SDK

The Zebra WMI provider includes the following test utilities:

  • Scanner WMI C# Sample Application
  • Driver WMI C# Sample Application

Each test utility demonstrates the main functionalities of the Zebra WMI provider. You can gain an understanding of the Zebra WMI provider using these test utilities. This chapter also describes how to use the test utilities' functionality.

NOTES Microsoft©.Net Framework v2.0 or later may need to be installed to execute C#.Net sample applications. If so, Microsoft detects and informs the user of this requirement.

Scanner WMI C# Sample Application

The Zebra Scanner WMI C#.Net sample application enables you to simulate an application which communicates with the Zebra Scanner WMI provider. The utility demonstrates the functionality of the Scanner WMI provider. It includes C#.Net source code and its solution, and project files for further reference.

The Scanner WMI C# Sample Application is included with the standard installation of the Scanner SDK, or when the Scanner WMI Provider Sample Application option of the custom Scanner SDK installation is selected.

To access this window, go to the Programs menu under Zebra Scanner → WMI → Remote Mgmt - WMI - Scanner Provide Sample App.

Figure 1: Scanner WMI Sample Application

Table 1: Scanner WMI Test Utility - Button/Field Functionality

Button or Field Description
(Host) Name or IP Address Specifies the name or IP address of the computer to connect. The default is localhost.
Connect Connects to the host specified in the Name or IP Address field, populates Method and Property lists, and registers to receive scanner discovery events and firmware update events.
Discover Discovers scanners connected to the host device.
Model Number Extracted from the part number of all discovered scanners.
Serial Number The serial numbers of the scanners under the model selected from the Model Number drop-down list.
Firmware Version The firmware version of the selected scanner.
Manufacture Date The manufacture date of the selected scanner.
Method

Drop-down list containing the following items:

  • GetAllAttributes: Gets all attribute identities in an XML string and displays them in the output box.
  • GetAttributes: Gets detailed attribute information of attribute numbers specified in the parameter input box, and displays them in the output box.
  • ScanDisable: Disables scanner.
  • ScanEnable: Enables scanner.
  • SetAttributes: Sets the list of attribute values specified in the parameter input box. These values are volatile, and are discarded after a device reboot.
  • StartNewFirmware: Starts the scanner with newly downloaded firmware.
  • StoreAttributes: Stores the list of attribute values specified in the parameter input box. These values are non-volatile, and persist after a device reboot.
  • UpdateAttribMetaFile: Updates attribute meta data with contents of the file specified in the parameter input box.
  • UpdateFirmware: Displays an Open window for selecting the firmware file.
IN Param Name Name of the input parameter of the item selected in the Method drop-down list, if applicable.
IN Param Value Text field to enter the value of the input parameter required for the selected method, if applicable.
Execute Invokes the method selected in the Method drop-down list. If the method requires an input parameter value, enter it in the text box.
Query Properties List of properties that can be queried. This list is not comprehensive. Use the GetAttributes method to discover additional scanner attribute values.
Get Queries one or more properties selected in the list box and display results in the output text area. You can select multiple items in the list box at a time.
Management Data Displays the results of a method execution or property query.
Firmware Update Status Displays the firmware update status received from Firmware Update Events.
Clear Clears text in the data output areas.
Retrieve from Scanner Retrieves all storable attributes from the scanner and stores them in the clipboard.
Retrieve from File Opens a window to read in an .xml file containing attribute settings to the clipboard.
Save to File Save clipboard contents to a file. Provides a Save as window to select the filename.
Push Opens the Cloning window that you can use to push the clipboard contents to selected scanners.
Retrieve Retrieves all storable attributes from the scanner and populates the Parameters drop-down list with the attributes. When you select an attribute in the list, the Value drop-down list changes to match its content (True / False or text box). The Value list also displays the current value.
Set Parameter Stores the current value of the selected attribute.

Driver WMI C# Sample Application

The Zebra Driver WMI C#.Net sample application enables you to simulate an application that communicates with the Zebra Driver WMI provider. The utility demonstrates the functionality of the Driver WMI provider. It includes C#.Net source code and its solution and project files for further reference.

The Driver WMI C# Sample Application is included with the standard installation of the Scanner SDK, or when the Driver WMI Provider Sample Application option of the custom Scanner SDK installation is selected.

To access this window select the Programs menu under Zebra Scanner → WMI → Remote Mgmt - WMI - Driver Provide Sample App.

Figure 2: Driver WMI Sample Application

Table 2: Driver WMI Test Utility - Button/Field Functionality

Button or Field Description
(Host) Name or IP Address Specifies the name or IP address of the computer to connect. The default is localhost.
Connect Connects to the host specified in the Name or IP Address field, populates Method and Property lists, and registers to receive scanner discovery events and firmware update events.
Method

Drop-down list containing the following items:

  • GetDeviceTopology: Get the topology that devices are connected to the specified computer.
  • RebootScanner: Reboot a specified scanner or all scanners connected.
  • SwitchHostMode: Switch the USB communication protocol of a specified scanner. Permanent change and silent switch parameters can be set as input parameters.
  • UpdateAttribMetaFile: Updates attribute metadata with contents of the file specified in the File Path text box.
Input Parameters Name of the input parameter of the item selected in the Method drop-down list, if applicable.
Execute Invokes the method selected in the Method drop-down list. If the method requires an input parameter value, enter it in the text box.
Query Properties List of properties that can be queried.
Get Queries a property selected in the list box and display results in the Management Data text area.
Management Data Displays the results of a method execution or property query.
Listen Scanner PNP Event Listen to the scanner attach and detach events and display the results in the text area.
Autoswitch Host Mode Automatically switch the HID Keyboard scanners to IBM Hand-held scanners.
Clear Clears the output.