function onResult (decodeResults, readerProperties, output)
{
var myoutput;
var result_tmp = dmccCommand("BEEP", 1, 1);
result_tmp = dmccSet("FTP-IMAGE.IP-ADDRESS", "192.168.23.42");
if(result_tmp.status !=0)
{
throw("FATAL: failed to set the ftp server address");
}
var mac = dmccGet("DEVICE.MAC-ADDRESS");
myoutput = 'Result="' + decodeResults[0].content + '", MAC='+mac.response;
output.content = myoutput;
}
In case the DMCC set command for the IP address fails, a non-zero status will be returned, and a script exception will be
thrown that is reported by the DataMan Setup Tool.
Note: If you use the Throw() command, like in the example above, to report the occurrence of an anomalous
situation (exception), the error will appear in the Setup Tool's error log. To access the error log, in the Setup Tool's
menu bar, click System and then click Show Device Log.
Example
To get the device name using the dmccGet function the correct string argument is required:
var res = dmccGet("DEVICE.NAME");
The dmccSend function can be used in a similar way, but without splitting the command and type correct arguments:
var res = dmccSend("GET DEVICE.NAME");
The return value is the same.
DMCC Support
The following DMCC commands are available for Script-Based Formatting:
Command
GET/SET FORMAT.MODE
SCRIPT.LOAD
SCRIPT.SEND
Auxiliary Functions
The following auxiliary global functions are also available:
function for decoding escape sequences
l
function to encode a string argument into base64 encoding
l
Function decode_sequences
This global function is used to decode escape sequences. The function returns the string that contains the decoded
escape sequence. The return value can be used to add keyboard control commands to a result transmitted over a HID
connection.
Range
Select formatting mode:
[0..1]
0 = basic formatting
l
1 = script-based formatting
l
length
Load the formatting script from the host to the reader.
-
Send the formatting script from the reader to the host.
DataMan Application Development
Description
26
Need help?
Do you have a question about the DataMan and is the answer not in the manual?