RSM Meta Tag

PocketBrowser 3.x API

The RSM Meta Tag is used to configure and retrieve attribute settings of a remote scanner connected to the device via cable or Bluetooth. When used for retrieval, navigation to a URL and/or calls to JavaScript functions are executed immediately. See the Remarks section below for a list of readable/configurable scanner attributes.

RSM (META Tag) Syntax
<META HTTP-Equiv="RSM" content="[parameter>

Items listed in this section indicate methods or, in some cases, indicate parameters which will be retrieved.

Name Description
Default Value
[Attribute] Marks the specified attribute to be returned when RSMGetEvent is next called. Applicable attributes are all those in the table in the remarks section listed as readable. N/A
Copy methods template to clipboard: Copy META Tag template to clipboard META Tags Copy Javascript template to clipboard Javascript

Items listed in this section indicate parameters, or attributes which can be set.

Name Possible Values Description
Default Value
[Attribute]:[Value] ID of Scanner, obtained via EnumScanner Causes the specified attribute of the remote scanner to be configured with the stated value. The table in the remarks section lists those writeable attributes which can be configured along with their range of possible values. Device Dependant
Copy parameters template to clipboard: Copy META Tag template to clipboard META Tags Copy Javascript template to clipboard Javascript

Modules return information back to their web pages via retrieval tags, for example the scanner has a retrieval tag called 'DecodeEvent' which is called whenever it decodes a barcode. To register to receive a retrieval tag call the module as follows:

<META HTTP-Equiv="[Module]" content="[RetrievalTag]:url('[URI]')">
So to register to retrieve the Scanner's DecodeEvent the following syntax would be used:
<META HTTP-Equiv="Scanner" content="DecodeEvent:url('Javascript:doScan('%6', '%s', %3, '%2');')">

Retrieval tags return information by replacing the text in place holders, defined as '%s' or '%<number>'. Each place holder represents 1 return value with '%s' being populated sequentially or '%<number>' providing direct acces to the desired value.

If the content for the Scanner's DecodeEvent is:

"url('Javascript:doScan('%6', '%s', %3, '%2');')"

The function would be called as follows:
"Javascript:doScan('Decode', '5449000053879', 0x35, 'SCN:EAN13');"


RsmGetEvent

ID Name Description
1 AttributeArray Array of attribute values. The attributes returned in this array are those registered for by calls to RSM prior to calling RSMGetEvent. The table in the remarks section gives the possible values associated with each attribute, if an attribute is not supported then 'Unsupported Attribute' will be returned in that attribute's array position.
Copy this return value template to clipboard: Copy META Tag template to clipboard META Tags Copy Javascript template to clipboard Javascript



The following example configures some parameters associated with the remote Bluetooth scanner:

<META HTTP-Equiv="Scanner" Content="Enabled">
<META HTTP-Equiv="RSM" Content="BluetoothAuthentication:True">
<META HTTP-Equiv="RSM" Content="BluetoothPincode:5678">
<META HTTP-Equiv="RSM" Content="BluetoothReconnectAttempts:6">
<META HTTP-Equiv="RSM" Content="BluetoothBeepOnReconnectAttempt:True">
<META HTTP-Equiv="RSM" Content="BluetoothPINCodeType:UseStored">
<META HTTP-Equiv="RSM" Content="BluetoothAutoReconnect:OnPowerOutOfRange">
Copy example to clipboard Copy example to clipboard

The following example retrieves some attributes of the Bluetooth Scanner:

<SCRIPT TYPE="TEXT/JAVASCRIPT">
function RSMNav(attributeArray)
{
//  Receive array of attribute values in the order they were registered and populate SPAN tags.
var spanID;
var spanElement;
for(i=0; i < attributeArray.length; i++)
{
spanID = "Span" + (i+1);
spanElement = document.getElementById(spanID);
spanElement.innerText = attributeArray[i];
}
}
function onTest()
{
var Generic = new ActiveXObject("PocketBrowser.Generic");
//Invoke some attributes to be returned 
Generic.InvokeMETAFunction('RSM', 'ModelNumber'); //  Array Index 0
Generic.InvokeMETAFunction('RSM', 'SerialNumber');            
Generic.InvokeMETAFunction('RSM', 'BluetoothAddress');        
Generic.InvokeMETAFunction('RSM', 'BluetoothPINcode');
Generic.InvokeMETAFunction('RSM', 'BluetoothFriendlyName');
Generic.InvokeMETAFunction('RSM', 'ProximityEnable'); //  Array Index 5
//  Finally Invoke the Navigation, this will call RSMNav with the array of parameters we have registered for above.
Generic.InvokeMETAFunction('RSM', "RsmGetEvent:url('JavaScript:RSMNav(%s);')");
}
</SCRIPT>
<HTML>
<HEAD>
<META HTTP-Equiv="reloadbutton" content="show">
<!-- Scanner must be enabled to use RSM functionality -->
<META HTTP-Equiv="Scanner" Content="Enabled:SCN2">
</HEAD>
<BODY>
<a href="javascript:onTest()">Get Values</a><br>
Model Number: <span id=Span1></span><br>
Serial Number: <span id=Span2></span><br>
BT Address: <span id=Span3></span><br>
BT PINcode: <span id=Span4></span><br>
BT Friendly Name: <span id=Span5></span><br>
Proximity Enable: <span id=Span6></span><br>
</BODY>
</HTML>
Copy example to clipboard Copy example to clipboard
The following is a mapping between Attributes, their possible values and whether they are read / write:
Attribute                      Access  Associated Value
ScanLineWidth                    RW    The laser scan line width, 'Wide' or 'Narrow'.
DecodeFeedback                   RW    The remote scanner beeps and illuminates its green LED on a 
                           successful decode.  'Enabled' or 'Disabled'.
ModelNumber                      R     The model number    
SerialNumber                     R     The serial number    
DateOfManufacture                R     Date of manufacture as DDMMYY    
DateOfService                    R     Date of service as DDMMYY    
BluetoothAddress                 R     Bluetooth address as FF:FF:FF:FF:FF:FF where FF is a hex number.    
BluetoothAuthentication          RW    'True' if authentication is required, else 'False'    
BluetoothEncryption              RW    True' if encryption is required, else 'False'    
BluetoothPINcode                 RW    Up to 5 character PIN code used for Bluetooth authentication    
BluetoothReconnectAttempts       RW    How long the scanner tries to re-establish connection if it goes 
                           out of range, in seconds.  This value must be a multiple of 5
                           and in the range 30 to 60 seconds.
BluetoothBeepOnReconnectAttempt  RW    When 'True' scanner will emit 5 beeps every 5 seconds whilst 
                           re-connection in progress, else 'False'    
BluetoothHIDAutoReconnect        RW    'NeverReconnect', 'ReconnectOnData' or 'ReconnectImmediately'    
BluetoothFriendlyName            RW    Friendly Bluetooth name, e.g. 'MyBTScanner'    
BluetoothPINCodeType             RW    'PromptUser' to prompt the user for the PIN code or 'UseStored' to 
                           use the code stored in memory.    
BluetoothInquiryMode             RW    'General' to use a general inquiry mode, else 'Limited'    
IgnoreCode128USPS                RW    Feature for ignoring Code 128 barcodes beginning with 420 and 421,
                           'Enabled' or 'Disabled' 
Mems                             RW    Mems scanner 'Enabled' or 'Disabled'    
ProximityEnable                  RW    Proximity feature 'Enabled' or 'Disabled'    
ProximityDistance                RW    Specify the distance for the proximity feature as 'Short', 'Medium' 
                           or 'Long'    
PagingEnable                     RW    Specify whether paging the device is 'Enabled' or 'Disabled'    
PagingBeepSequence               RW    Range '0' to '15' to specify the pattern for the paging beep 
                           sequence.    
LowBatteryIndication             RW    Low battery indication 'Enabled' or 'Disabled'    
ScanTriggerWakeup                RW    Scanner trigger will wakeup the device from a low power state, 
                           'Enabled' or 'Disabled'    
BluetoothAutoReconnect           RW    Bluetooth reconnection scheme: 
                             'None' - No scheme
                             'OnPower' - when powered on
                             'OnOutofRange' - when device goes out of range
                             'OnPowerOutofRange' - when powered on or when device goes out
                             of range.    
LowBatteryIndicationCycle        RW    Low battery indication cycle time, in seconds 
                           ('10', '20', '30', '40' or '50').   
ProximityContinuous              RW    Proximity continuous mode 'Enabled' or 'Disabled'
GoodScansDelay                   RW    Delay between good scans in proximity continuous mode, measured in miliseconds.
                           Range 0 to 15000.  This value must be a multiple of 100.                                         
PagingActivate                   W     'Start' or 'Stop' paging to the scanner.
BTDisconnect                     W     Command scanner to disconnect from its connected device.
BTUnpair                         W     Command scanner to unpair from its paired device.  Allows scanner to associate
                           with a different device.
FirmwareVersion                  R     Scanner's operating system version.    
DeviceClass                      R     The device class of the system    
BatteryStatus                    R     Indicates the status us the scanner's battery, 'Unknown', 'Full', 
                           'Medium', 'Empty', 'Charging-FullRate', 'Charging-HalfRate', 
                           'Charging-Trickle' or 'Discharging'    
BatteryCapacity                  R     Remaining capacity of the battery, integer in the range '0' to 
                           '100'.  'Unknown' if unable to determine, e.g. if no battery in the scanner.    
BatteryID                        R     'Simple', 'Double', 'Cabled', 'Unknown'    

Supported Platforms Windows CE, Windows Mobile, Windows Mobile SE
Persistence This tag is persistent.
Min. Requirements This tag requires appropriate hardware to run, i.e. a remote scanner and a device which supports it.