Altova MobileTogether Designer

Zebra Connect/Disconnect

Home Prev Top Next

The Zebra Connect action and Zebra Disconnect action (screenshot below), respectively, starts and ends a connection between the MobileTogether client and a Zebra barcode scanner. Select the Connect or Disconnect radio button according to what you want to do.

MTActionZebraConnectDisconnect

Zebra Connect

The Zebra Connect action connects to a Zebra scanner based on the settings you select (listed below). For example, if the scanner is connected via a USB cable, then select USB as the connection type. You can select a setting's value either from the corresponding dropdown list or by entering an XPath expression that selects a valid value. (The advantage of using an XPath expression is that a value can be selected dynamically (for example, from a node of a page source).) An XPath expression must evaluate to the string equivalent of one of the values in the corresponding dropdown list.

 

The action's settings are:

 

Connection Type: Can be (i) Bluetooth Classic/Cradle Host (for older Android versions); (ii) Bluetooth Low Energy (Bluetooth LE) (for most Android and iOS devices, especially newer versions); (iii) USB (for Android and Windows).

Configuration Type. What scanner configuration to use: (i) the scanner's current configuration; (ii) whether to set factory defaults; (iii) restore the scanner's default configuration (not different from the previous option). Note that, if the second or third option is selected (to go to the default configuration), then the scanner's configuration is reset but the connection will not be made; the connection must be made in a second and subsequent Zebra Connect action where Configuration Type is set to Keep Current.

 

When the Connect action to a Zebra scanner via Bluetooth is triggered at runtime, a dialog appears in the solution. It contains a list of available Bluetooth devices and a barcode. The end-user must select from the device list the Zebra scanner to use and then, with this scanner, scan the barcode in the solution's dialog. This starts the pairing of the MobileTogether client device with the Zebra scanner. You can use the mt-zebra-scanner-connected() function to check whether the Zebra scanner is connected.

 

Once the pairing is complete, barcodes that are scanned by the Zebra scanner will be read into the $MT_ZEBRASCANNER page source tree.

 

Zebra Disconnect

The Zebra Disconnect action ends the connection. It is advisable to end the connection after the barcode you want has been scanned. Otherwise, a scan can occur inadvertently and replace the originally scanned data in the page source tree.

 

MobileTogether variables

MobileTogether provides a large number of global variables and local variables.

 

Global variables are static: that is, their values do not change across contexts or during solution execution. For example, the value of $MT_CameraAvailable—which indicates the availability of a device camera—if true() at the start of solution execution will remain true() at all times during solution execution.

Local variables, on the other hand, are dynamic. Their values can change when the execution context changes or when a device property changes. The value of the $MT_Portrait local variable, for example, can switch betwen true() and false() according to the orientation of the device.

 

If a MobileTogether variable is especially relevant to this action, it is listed below. For a full list of variables and their descriptions, see the topic Global Variables.

 

$MT_BluetothAvailable

$MT_BluetothLEAvailable

 

MobileTogether extension functions

MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.

 

mt-bluetooth-started()

mt-zebra-scanner-id()

mt-zebra-scanner-connected()

 

© 2018-2024 Altova GmbH