D028868 CR1500 CR1100 CR2700 JavaScript Programming Guide User Manual Page 5 of 41
The Code Corporation
12393 South Gateway Park Place, Suite 600, Draper, UT 84020
+1 (801) 495-2200
FAX +1 (801) 495-0280
Data in Code Reader Local Storage ............................................................................................................................. 24
13.3 Comm Object ........................................................................................................................................... 24
Informational Properties ............................................................................................................................................. 25
comm.isConnected ............................................................................................................................................ 25
Comm methods ........................................................................................................................................................... 25
comm.connect ................................................................................................................................................... 25
comm.disconnect ............................................................................................................................................... 25
comm.sendPacket .............................................................................................................................................. 25
comm.sendText ................................................................................................................................................. 25
comm.sendMessage .......................................................................................................................................... 26
comm.getSendStatus ......................................................................................................................................... 26
comm.sendUsbScanCode .................................................................................................................................. 26
comm.sendUsbScanCodes ................................................................................................................................. 26
comm.sendHidReport ........................................................................................................................................ 27
13.4 Shell Functions ......................................................................................................................................... 27
help([name]) ................................................................................................................................................................ 27
include(name) ............................................................................................................................................................. 27
print (string) – see reader.print(string) ....................................................................................................................... 27
gc() ............................................................................................................................................................................... 27
sleep_ms(time_ms) ..................................................................................................................................................... 27
format(string format, ...) ............................................................................................................................................. 27
wdt_pet() ..................................................................................................................................................................... 28
logMessage(string) ...................................................................................................................................................... 28
13.5 Pre-defined Scripts ................................................................................................................................... 28
.jseLib.js library functions ............................................................................................................................................ 28
storage.findFirst(regex) ..................................................................................................................................... 28
storage.findNext() .............................................................................................................................................. 28
reader.setInterval (func, interval) ...................................................................................................................... 29
reader.clearInterval(intervalId) ......................................................................................................................... 29
reader.setTimeout (func, delay) ........................................................................................................................ 29
reader.clearTimeout(timeoutId) ........................................................................................................................ 29
reader.tick1Hz() – default implementation ....................................................................................................... 29
This implementation is used to manage the internal “interval” timers. ................................................................................... 29
cra.js ............................................................................................................................................................................ 29
reader.onEvent(event) ....................................................................................................................................... 29
reader.onDecodeAttempt(count) ...................................................................................................................... 30
reader.onDecode(decode) ................................................................................................................................. 30
reader.onDecodes(decodes) .............................................................................................................................. 30
reader.onConfigure(data) .................................................................................................................................. 30
.codeRules.js ................................................................................................................................................................ 30
rules_onDecodes ............................................................................................................................................... 30
rules_onDecodeAttempt ................................................................................................................................... 31
rules_onDecode ................................................................................................................................................. 31
rules_onEvent .................................................................................................................................................... 31
rules_onConfgure(data) ..................................................................................................................................... 32
Optional Global variables ................................................................................................................................... 32
.setttings.js .................................................................................................................................................................. 32
jsSettings.def(param, val) .................................................................................................................................. 33
jsSettings.put(param, val) .................................................................................................................................. 33
jsSettings.set(param, val) ................................................................................................................................... 33
jsSettings.reset(param) ...................................................................................................................................... 33
jsSettings.get(param) ......................................................................................................................................... 33