CETerm Scripting Guide for Version 5.5.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Copyright Notice This document may not be reproduced in full, in part or in any form, without prior written permission of Naurtech Corporation. Naurtech Corporation makes no warranties with respect to the contents of this document and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Table of Contents Copyright Notice .............................................................................................................................. 2 Trademarks...................................................................................................................................... 2 Software Version ......................................................................................................
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Properties ............................................................................................................................... 49 3.8 The GPS Object ................................................................................................................... 50 Methods ..................................................................................................................................
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Example for Windows Mobile devices .................................................................................... 88 4.6 The OnNavigateRequest Event ........................................................................................... 89 Syntax..................................................................................................................................... 89 Example..............................
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 5.6 Accessing a File ................................................................................................................. 110 5.7 Accessing the Registry ...................................................................................................... 111 5.8 Controlling a Serial Port from CETerm .............................................................................. 112 5.8.1 SerialPort Objects .......
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Preface All of us at Naurtech Corporation constantly strive to deliver the highest quality products and services to our customers. We are always looking for ways to improve our solutions. If you have comments or suggestions, please direct these to: Naurtech Corporation e-mail: support@naurtech.com Phone: +1 (425) 837.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Additional Documentation Naurtech Scripting is an integral feature of Naurtech Web Browser and Terminal Emulation Clients. Please refer to the User‟s Manual for detailed installation and configuration information. The User‟s Manual may be downloaded from the “Support” section of www.naurtech.com.
1.0 Introduction The Naurtech CETerm Clients provide a robust and flexible environment for Terminal Emulation and Web based applications on a mobile device. Our Clients are available for most Windows CE platforms including CE .NET 4.2, Windows CE 5.0, Windows CE 6.0, Windows Mobile 2003, Windows Mobile 5, and Windows Mobile 6. Device tailored versions of our Clients are available for most industrial terminals.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE You may also need to consult standard references for HTML syntax, the browser Document Object Model (DOM), and other aspects of Dynamic HTML if you are scripting web browser features. Please refer to the Naurtech User‟s Manual for details on basic usage and configuration of the Naurtech clients. We hope that our Scripting features will enrich and extend the capabilities of your TE and browser applications.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Workflow Automation. Scripts can be used to automate routine tasks. The task may be a simple login process or a complex set of steps in your host application. Event Activated Scripts. There are several events within CETerm that will run associated scripts.
2.0 Getting Started This section describes some common ways that scripting features can be used within CETerm. Here we describe the JavaScript engine in CETerm and show how to load and edit a script. We also show sample scripts which (1) handle scanner input, (2) auto-login a terminal emulation session, and (3) provide userspecified “hot-spots” on the screen. Only small code “snippets” are shown. For complete details see the later sections of this manual. 2.
2.2 ENABLING SCRIPTING AND EDITING SCRIPTS Scripting is disabled by default. To enable scripting, open the configuration dialog [Session]->[Configure]->[Options]->[Configure Scripting] General Settings On the General tab, check the Enable box and check Show Script Errors. You may also want to enable file and registry access permission or program launching if you need these features.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE After selecting a script slot and tapping the Edit button, an Edit Script dialog will appear. The edit dialog allows Import and Export of scripts. For initial script development it may be easier to edit on your desktop PC, copy the script to the device, and Import the script. You can use any programming editor that does not insert text formatting commands.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE current script is a function definition, it will be checked for correct syntax and will be made available to the script engine. If the current script contains executable statements or is a function call, it will simulate activating the script. In general, you do not want to use Test/Load for executable statements.
2.3 CETERM AUTOMATION OBJECTS The CETerm Automation Objects provide access to the running CETerm application, session screens, device hardware, the Windows CE operating system, and other features. For example the command CETerm.PostIDA( "IDA_SESSION_S1", 0 ); within a script would switch CETerm to Session 1 if another session was currently active. Automation Objects can give access to the browser Document Object Model (DOM) of connected web sessions and the text on terminal emulation sessions.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE /* OnBarcodeRead */ function OnBarcodeRead ( session, data, source, type, date, time ) { // Manipulate barcode data here // Send barcode to emulator CETerm.SendText ( data, session ); // Return 0 to handle barcode normally // Return 1 if handled data here return 1; } This handler simply passes the barcode data on to the current session using the “SendText” method.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Prefix zeros to short barcodes if (data.length == 8) { data = "000" + data; } // Send barcode to emulator CETerm.SendText ( data, session ); // Return 1 if handled data here return 1; } The following OnBarcodeRead handler will split any barcode containing an ASCII Linefeed (LF = 0x0A) character and terminated with an ASCII ENQ (ENQ = 0x05) into two parts.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE } } // Handle scan data in normal way return 0; } The type argument to OnBarcodeRead contains the labeltype of the barcode. This labeltype is related to the barcode symbology but usually a little more informative. The values are dependent on the hardware manufacturer but for most devices are the same as the Symbol LABELTYPE. The type is a small integer value representing a printable ASCII character (See Appendix 3).
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var waittime = 8000; // Milliseconds waiting for each text // Only login session 1 if (session == 1) { // Look for "login" then "password" expect( session, waittime, "Login", myusername + "\r", "Password", mypassword + "\r" ); } } The expect arguments are session for the session index, waittime for the milliseconds waiting for each expected text, followed by pairs of expected text (prompt) and corresponding action(response)
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 2.7 CUSTOM SCREEN HOT-SPOTS A “hot-spot” is an area on a terminal emulation screen that is activated by taping with your finger or the stylus. CETerm supports several pre-defined hot-spots for TE sessions. With scripting, it is possible to define custom hot-spot behaviors. Custom hot-spots use the “OnStylusDown” event handler.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE case case case case } 1: 2: 3: 4: IDA IDA IDA IDA = = = = "IDA_VT_PF1"; "IDA_VT_PF2"; "IDA_VT_PF3"; "IDA_VT_PF4"; break; break; break; break; // DEBUG: Uncomment next two lines for testing //OS.Alert( "row=" + row + " col=" + column + // " button=" + button + " IDA=" + IDA ); if (!IDA.match("IDA_NONE")) { // Send command CETerm.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 2.8.1 Array Literals Here is a simple JavaScript statement that uses an array literal to create an array and assign it to a JavaScript variable: var myArray = [ 2, 4, 6 ]; myArray[2] now has the value 6.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 2.8.4 Optional Object Properties The object literal returned as a result may not always contain all possible properties. This is true for the File.GetList() method. The various file timestamps are not always present. Your JavaScript code must check these values or be prepared to handle the “undefined” value that can result.
3.0 CETerm Automation Objects This section describes the Automation Objects available to the CETerm script engine. These objects provide access to the running CETerm application, TE session screens, the Windows CE operating system, hardware device components, and other features for developing rich applications. The automation objects are accessed in a hierarchical manner similar to the Document Object Model (DOM) of a webpage. The three top-level objects are CETerm, Device, and OS.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE ClearTimeout GetProperty PlaySound PlayTone PostIDA RunScript SendIDA SendText Session SetInterval SetProperty SetScriptTimeout SetTimeout Clear a one-time timer Get a property value Play a tone or wave file on the device (deprecated) Play a tone on the device (deprecated) Send a command to a session (asynchronous) Run a script (called from a web browser only) Send a command to a session (synchronous) Send text to a session G
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE but it will also accept a “tone specifier” as a string to support this legacy feature in the Naurtech Web Browser. New application should use the OS.PlaySound or OS.PlayTone commands. Use the complete file path if the wave file is not in the \Windows directory. If the handheld device contains a programmable tone generator, the sound parameter may also be a string which defines a sequence of tones to play.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE defined script from the web browser. To execute a script contained in a string from the CETerm engine use the JavaScript “eval()” method. SendIDA ( IDASymbolicName, session ) SendIDA sends an IDA action command and directs it to the specified session. Valid session values are 1 to MaxSession. The special session value of 0 will send the command to the current session. See Appendix 1 for IDA Symbolic Names.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE this timer. The scriptExpression is a string containing the script, but is commonly a function invocation, such as “myTimerFunction( 3, „alert‟ );” Timers are especially useful with complex or long-running scripts. Interval timers can be used to perform simple update tasks. One-time timers should be used in preference to interval timers. In general, scripts should perform a short action and exit.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Properties The CETerm object has the following properties. Property Description Values ActiveSession Current active session. (read only) MaxSession Message TextInput Maximum session index. (read only) Returns message object. (read only) Return text input object. (read only) 1MaxSession 5 object object 3.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE batteryStatus = GetBatteryInfo ( ) Get the battery charge information. Returns a JavaScript object literal with the information in the form: {ACLineStatus:0x1, main:{flags:0x1, lifePercent:100, lifeTime:4294967295, fullLifeTime:4294967295, voltage:4178, current:0, averageCurrent:0, averageInterval:0, mAHourConsumed:0, temperature:3.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE object = SerialPort ( index ) Return the corresponding SerialPort object. Valid index values are 0 through 9. See Chapter 5 for details on how to use the SerialPort object. status = Vibrate( durationMillisec ) Activate the device vibrator for the specified duration in milliseconds. Return 0 on success or -1 otherwise. For most devices, this method is synchronous and will not return until the vibration is complete.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 3.3 THE OS OBJECT The top level OS object provides access to operating system resources such as files, processes, windows, and the registry. Many of the automation objects on the OS hierarchy give direct access to lowlevel Windows CE features. Although powerful, caution should be exercised when using these features. We provide the basic API documentation in this document.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Use GetErrorMessage() to convert a non-zero status to a text message. You should immediately save the property LastExecProcess after a successful Exec call to obtain the process ID for later use in WaitForProcess or KillProcess. The programFile should be a fully qualified filename. This function is deprecated. Full process control is now provided by the Process object.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Sleep ( delay ) Delay script execution for specified milliseconds. result = StopSound ( ) Stop any currently playing sound. Returns 0 on success. status = WaitForProcess( processID, timeout ) Wait for the specified process to exit. Return after timeout milliseconds even if process is still running. Return 0 if process has exited, non-zero for timeout or failure.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property Description Values Network Returns the Network object. This object provides access to Windows network features. (read only) Returns the Process object. This object provides control of running Windows programs. (read only) Returns the Registry object. This object provides access to the Windows registry. (read only) Returns the current tick count from Windows. This provides a millisecond resolution time source.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 3.4 THE BROWSER OBJECT The Browser object gives access to a web browser session. The Browser object is a property of the Session object; CETerm.Session(i).Browser. This section documents the methods and properties of the Browser object. Methods The following methods are available Method Action AddMetaItem Navigate RunScript Add a CETerm element to the current web page. Navigate to specified URL.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Properties The following read-only properties are available. Property Description Document Document object of the current web page. object The DOM of the page may be examined and altered via this object. WARNING: Use a local variable to hold this reference to minimize memory usage. (read only) Returns true if document is loaded. (read true, only) false DocLoaded Values 3.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE GetHandlerScript IsExistingEvent IsListenerSet Pulse Returns the handler script for an active listener. Returns status of an event handle. Returns status of a listener on a single event. Signals all listeners that an event is set, then resets the event to the non-signaled state Reset Reset an event to the non-signaled state. Set Set an event to the signaled state. SetListener Assign a handler script to an event.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = Delete ( eventHandle ) Delete the specified eventHandle from management. The Create() method must have been used to create the eventHandle. For convenience, you may specify the eventName used in the Create() call rather than the eventHandle. Delete() will clear the event listener if it exists. After deleting an eventHandle, it can no longer be used for any event operations.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE script = GetName ( eventHandle ) Return the name of the event associated with the specified eventHandle. Return null if no listener found. status = IsExistingEvent ( eventHandleOrName ) Return the status of the event with the given eventHandle or eventName. Return 0 if the event does not exist, 1 if the eventName exists within Windows, 2 if the event was created within Windows by the Create() method, or -1 on error.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = SetListener ( eventHandleOrName, handlerScript, timeout ) Assign a handler script to an event. The eventHandle is obtained from a Create() call. If you use an eventName, the event must have been previously created within Windows by Create() or by another program. The handlerScript will be queued for execution if the event is signaled within timeout milliseconds.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 3.6 THE FILE OBJECT The File object provides access to the Windows file system. The File object is a property of the OS object; OS.File. Methods The following methods are available Method Action Append Copy CreateDirectory Delete GetAttributes GetList GetOpenFileName GetSaveFileName Move Read RemoveDirectory SetAttributes Write Append content to a file. Create a copy of an existing file. Create a new directory.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = CreateDirectory ( newDirectory ) Create a new directory. Return true for success, false for failure. Use the File properties LastError or LastErrorMessge to get additional error information. status = Delete ( fileName ) Delete an existing file. Return true for success, false for failure. Use the File properties LastError or LastErrorMessge to get additional error information.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE reference for details on the Date() constructor arguments. See Appendix 4 for attribute definitions. filename = GetOpenFileName ( title, filter ) Return the name of a file specified by the user in an Open file dialog. The title of the dialog should contain descriptive information for the user. For example, “Please select a datafile.” The filter is a list of filter pairs.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Use the File properties LastError or LastErrorMessge to get additional error information. status = SetAttributes ( fileName, attributes ) Set the attributes of the file. Return true for success, false for failure. Use the File properties LastError or LastErrorMessge to get additional error information. See Appendix 4 for attribute definitions. status = Write ( fileName, contents ) Write contents to the named file.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Methods The following methods are available Method Action CreateDirectory DeleteFile DeleteDirectory GetFile GetDirectory ListFiles Login Logout PutFile RenameFile SetDirectory Create a new directory on the remote host. Delete a file on the remote host. Delete a directory on the remote host. Get a file from the remote host. Get the current directory on the remote host. List files on the remote host.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE directory = GetDirectory ( ) Return the name of the current working directory on the host. Returns null on failure. Use the FTP properties LastError and LastErrorText to get additional error information. filelist = ListFiles ( pattern ) Return a list of remote files with names that match a pattern.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE success or non-zero otherwise. Use the FTP properties LastError and LastErrorText to get additional error information. status = Logout ( ) Close an open FTP connection. Return 0 on success or non-zero otherwise. Use the FTP properties LastError and LastErrorText to get additional error information. status = PutFile ( localName, remoteName ) Copy the named local file to the remote name.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property LastError Description Returns the last error value associated with any FTP operation. (read only) LastErrorText Returns a text description of the last FTP error as reported by the remote host. (read only) LoggedIn True if FTP session is currently established. (read only) OverwriteExistingLocalFile If true, GetFile() will overwrite an existing file with the same local name.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Methods The following methods are available Method Action Open Close GetPosition GetDeviceState Open the GPS device and enable operations. Close the GPS device. Read the current GPS position. Query the GPS device state. status = Open ( ) Open the GPS device and enable operations. This action will supply power to the GPS device if it is not already operational.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE latitude:47.64000000,longitude:-122.13000000, speed:0.0,heading:0.0,magneticVariation:0.0, altitudeSeaLevel:30.123,altitudeEllipsoid:50.00, fixQuality:1,fixType:1,fixSelection:1, positionalDOP:0.0,horizontalDOP:0.0,verticalDOP:0.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property Description Values DeviceStateChangeEvent Event ID of event signaled when GPS device state changes. If needed, you must set this value before calling Open(). The eventID must be obtained by calling OS.Event.Create() IncludeSatelliteData Include satellite data with position results if true. Default is false. IsOpen Indicates GPS device is open and enabled.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var p; var pl = Device.GPS.GetPosition(); // Parse position literal object eval( "p="+pl ); OS.Beep(); // Update display message CETerm.Message.Text = "Lat and Long will display values when" + " GPS obtains a location fix." + " Initial fix may take several minutes." + "\nPress ENTER when done.\nLat:" + p.latitude + "\nLong:" + p.longitude; // Reschedule event listener var s = OS.Event.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Assign initial listener script for GPS position event s = e.SetListener( ep, "UpdateGPSPosition();", 300000 ); // Assign event to GPS object g.NewLocationDataEvent = ep; g.MaximumAge = 5000; // Open GPS device s = g.Open(); // Prepare message display m.AbortButtonVisible = false; m.Title = "GPS Demo"; m.Text = "Initializing, please wait..."; m.IsVisible = true; // Create global hot-key to run Script 50 for cleanup k.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Method Action AssignHotKey DeleteHotKey DeleteAllHotKeys Enable IsEnabled IsHotKey IsKeyDown IsKeyDownNow IsKeyToggled SimulateKeyDown SimulateKeyUp SimulateKeyPress Assign a global hot-key. Delete a global hot-key. Delete all global hot-keys. Enable or disable the keyboard. Check the keyboard enabled state. Check if a global hot-key has been assigned. Check if a state key was down for the last key input.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = DeleteAllHotKeys ( ) Delete all global hot-keys. Return 0. status = Enable ( enabled ) Enable or disable the hardware keyboard. If enabled is true the keyboard is enabled, if false it is disabled. Not all devices support this action. Return the new keyboard state. WARNING: If the keyboard is disabled, it may render the device unusable and require a system reset.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = SimulateKeyDown ( vkCode ) Simulate the press of a hardware key. The vkCode is an integer “virtual-key code” between 1 and 254. See Appendix 5 for virtual-key values. This key event will be received by the current active (foreground) window which may not be CETerm. The key down action may also generate text input to the application. Typically SimulateKeyDown() is followed by a SimulateKeyUp().
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Example The following example shows how a global hot-key may be assigned to cycle between several running programs. This example also shows the use of several OS.Window methods. The hot-key invokes a CETerm script that will check which application is visible and switch to the next. The script is shown first. It must be imported into any CETerm script slot and marked “Load at Startup”.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Switch between CETerm, Calculator, and Media Player. ToggleApplications( /ceterm/i, /calc/i, "Media Player" ); The last step is to assign the hot-key to run Script #8. This can be placed in any script slot. It may be marked “Load at Startup” or the key could be assigned as part of other initialization scripts. For this example, Shift+Right_Arrow is the hotkey combination.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property Description AbortButtonVisible If true, a script abort button is visible. Taping this button will abort the current script execution. IsVisible If true, message dialog is visible. Progress Current progress value in percent. ProgressRate Rate of change of progress bar. In units of percent per second.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = Ping ( hostname, timeout ) Sends an ICMP packet to the hostname and waits timeout milliseconds for a reply. The hostname may be a text name or an IP address. Return the roundtrip response time in milliseconds. Return 0 for no response, or a negative value on error. Use the Network property LastPingError to get additional error information.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 3.12 THE PROCESS OBJECT The Process object provides access to running Windows processes. Processes can be started, killed, and listed. The Process object is a property of the OS object; OS.Process. Methods The following methods are available Method Action ExecuteAction GetList Kill WaitForExit Run a program or open a file via the specified action. Get a list of the running processes Stop (Kill) a running process.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE containing information about each process. See Section 2.8 for details about handling JavaScript literals. Return null if error. Use the Process property LastError to get additional error information. The returned literal has the following format: [ {processID:0x17fdf002, threads:2, name:"NK.EXE"}, {processID:0x17fcb266, threads:6, name:"filesys.exe"}, {processID:0xb7f67176, threads:85, name:"device.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 3.13 THE REGISTRY OBJECT The Registry object provides access to the Windows registry. The registry is a form of database on Windows devices which holds the device configuration. The registry has a hierarchical structure. The “keys” are similar to file folders and the “values” inside a key are similar to files in a folder. For a better understanding of the Windows registry, you can search for information at msdn.microsoft.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = DeleteValue ( keyname, valuename ) Deletes the specified value in an existing key. Returns 0 for success or non-zero for an error. keylist = EnumerateKeys ( keyname ) Return a list of sub-keys of the specified key. See Appendix 4 for key names and definitions. Each sub-key in the list is separated by the current StringSeparator property value.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE JavaScript array, but it is easy to convert a Visual Basic array into a JavaScript array using the VBArray object. For example: var valuename = "HKLM\\Comm\\PY21BG1\\Parms\\TcpIp\\DhcpDNS"; var vbarray = new VBArray( OS.Registry.ReadValueVBArray( valuename ); var jsarray = vbarray.toarray(); status = WriteValue ( valuename, valuedata, datatype ) Write the specified value.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Method Action GetText GetTextLine GetTextRect Get all text from start location to end location Get all text on a line Get a rectangle of text text = GetText ( startRow, startColumn, endRow, endColumn ) Return the requested range of text. Each line will be separated by the TextLineSeparator property value. If the session is not connected the JavaScript null value is returned.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property Description IBM emulation only. VT state can only be locked or unlocked. (read only) TextLineSeparator Text which separates every line in GetText methods. Values see Appendix 4 Default: nothing 3.15 THE SERIALPORT OBJECT The SerialPort object gives access to serial port functionality. The SerialPort objects are obtained from a Device object method; Device.SerialPort(i) where i is 0 through 9.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = CancelWaitForEvent ( ) Cancel the active event listener for the port. If canceled, changes in port status will not be reported through the event handler OnSerialPortEvent. Return 0 on success, non-zero for failure. status = ClearBreak ( ) Clear the break condition on the port. Return 0 on success, non-zero for failure. Use the SerialPort property LastError to get additional error information.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE data = Read ( maxCount ) Read up to maxCount bytes from the port. Return data as a string. Return null if no data or error. This method blocks until the maximum bytes are read or the read timeout expires. Data are converted from bytes to a wide character string by mbstowcs using the current locale. Use the SerialPort property LastError to get additional error information. data = ReadByte ( ) Read a single byte from the port.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = WaitForEvent ( ) Enable an event listener for the port. The listener waits for events that are specified in the property EventMask. If the event is signaled by the port, the event handler OnSerialPortEvent is invoked. The event handler is invoked only once for each call of WaitForEvent, but the handler parameters may indicate multiple event conditions. Return 0 on success, non-zero for failure.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE msdn.microsoft.com with the keywords “commtimeouts structure ce” and “DCB structure ce”. In general, you should set all necessary properties before opening the serial port. However, you may alter the properties of an open port by assigning new values. See Chapter 5 for additional details about using the SerialPort object. The SerialPort object properties are listed in the following tables.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE DCB Property DSROutputFlowControl Description Monitor DSR signal for output flow control. DTRControlMode DTR signal mode. Default is “enable when open” (0x1). EventCharacter Character that triggers EV_RXFLAG event. OutputContinueOnXOFF Continue output when XOFF has been sent to restrict input. ParityMode Parity scheme to use when parity checking is enabled. Default is “none” (0x0). RTSControlMode RTS signal mode.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Timeout Property Description Values ReadIntervalTimeout Maximum milliseconds allowed integer between the arrival of two (D:0xffffffff) bytes. If this time is exceeded the read call will return. A value of 0 means not used. With the special value 0xffffffff, the read operation will return immediately with all bytes already received if the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier are both zero.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Methods The Session object has no methods. Properties The Session object has several read only properties. Property Description Values Browser IsConnected Returns browser object. (read only) Returns true if session is connected. (read only) Returns screen object. (read only) object true, false Screen object 3.17 THE TEXTINPUT OBJECT The TextInput object provides user input in a script.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Properties The TextInput has the following properties. Property Description Values Input Can be pre-set with default response before calling GetInput. If GetInput returns 1, contains the user input. If true, input is shown as * characters. Text prompt message for user. Text in message box title bar. text PasswordMode Prompt Title true, false text text 3.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE GetTopmost IsEnabled IsVisible IsWindow PostMessage SendMessage SetTopmost Show Get the window with which the user is working. Check if window is enabled for input. Check if window is visible. Check if window handle is valid. Post a message to a window. Send a message to a window. Set a window as the current working window. Show or hide a window.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE {hwnd:0x7c015c50, processID:0x77452dda, text:"CETerm - S1"}, {hwnd:0x7c012320, processID:0xb7f67176, text:"Input Panel"}, {hwnd:0x7c011d40, processID:0xb79f7e32, text:"WinCENotify"} ] windowHandle = GetParent ( windowHandle ) Get the handle of the parent window. If the window is a child window, the return value is a handle to the parent window.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = IsVisible ( windowHandle ) Check the visibility state of the specified window. Return true if the window may be visible or false if the window is hidden. A window in the “visible” state may still be hidden from view by other windows. Use the Window property LastError to get additional error information. status = IsWindow ( windowHandle ) Check if the specified window handle is valid.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE status = SetTopmost ( windowHandle ) Set the specified window to be the topmost and active window. This is also called the foreground window. Return true on success or false on failure. status = Show ( windowHandle, visible ) Set the visibility state of the specified window. If visible is true, the window is set to the visible state. If visible is false, the window is hidden.
4.0 CETerm Script Events This section describes the script events within the CETerm script engine. These events provide ways to trigger event handlers when various conditions occur in CETerm. The event handlers are arbitrary scripts. The event model in CETerm uses specific event handler names to bind events to handlers. If the event handler function (e.g., “OnBarcodeRead”) is defined in the script engine, it will be executed when the event occurs.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 4.1 THE ONBARCODEREAD EVENT The OnBarcodeRead event is fired when a barcode is successfully read. The handler can pre-process the data or check other conditions prior to passing it on to a TE or browser session. Syntax function OnBarcodeRead ( session, data, source, type, date, time ) session – index of currently active session data – barcode data source – source of barcode. Typically a constant scanner name.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Return 1 if handled data here return 1; } 4.2 THE ONDOCUMENTDONE EVENT The OnDocumentDone event is fired when a new webpage has completed loading into a web browser session. The handler can add META tag definitions, examine or alter the Document Object Model (DOM), or add JavaScript methods to the page. This event allows CETerm to enhance a web page for mobile data collection that was not originally designed for such.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE b.AddMetaItem( "Signal", "y=100" ); // Update information items for location to take effect CETerm.PostIDA( "IDA_INFO_REFRESH", session ); } } 4.3 THE ONIBMCOMMAND EVENT The OnIBMCommand event is fired when a special extended command format is received in an IBM emulation session screen.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Submit screen to move to next action CETerm.PostIDA( "IDA_ENTER", session ); } 4.4 THE ONKEYBOARDSTATECHANGE EVENT The OnKeyboardStateChange event is fired when the state of the keyboard is changed by a user or host action. Typically this event is only used with IBM sessions. A VT session may generate this event only if custom escape sequences lock the keyboard.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE else { if (PreviousKeyboardState[session] === IBM_KEYBOARD_NORMAL_UNLOCKED) { CETerm.PostIDA( "IDA_SCAN_SUSPEND", 0 ); } } // Save new state PreviousKeyboardState[session] = state; } 4.5 THE ONNAVIGATEERROR EVENT The OnNavigateError event is fired if the browser fails to complete a navigation. Typically, the error handler will redirect the web browser to a “file:” URL on the device for error recovery.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Save params in text 3x where x is session index // This is required by CE 5.0 devices which do not pass // parameters to a "file:" URL. CETerm.SetProperty( "app.usertext.3" + session, params ); // Navigate to static error page var b = CETerm.Session( session ).Browser; b.Navigate( "file:///error.htm" ); } Note the CETerm.SetProperty() call. This method saves the params in persistent memory for later use by the "error.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 4.6 THE ONNAVIGATEREQUEST EVENT The OnNavigateRequest event is fired before the browser begins a navigation. Normally, all navigation control should be done within the HTML of a page. In rare cases when the pages cannot be modified, this handler can be used to control navigations. This handler can cancel a navigation or request an alternative navigation.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Continue all other navigations return 0; } 4.7 THE ONNETCHECKFAILED EVENT The OnNetCheckFailed event is fired if a “Network Check on Send” fails to detect the host system and the Network Check Action is “ida://IDA_SCRIPT_ON_NETCHECKFAILED”. Other Network Check Actions are possible, including direct naming of an error URL. See the User Manual for more information.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 4.8 THE ONPROGRAMEXIT EVENT The OnProgramExit event is fired just before CETerm exits. This handler can abort the exit to keep CETerm running. Syntax function OnProgramExit ( ) This handler has no arguments. The function returns 0 to continue with the exit or 1 to abort the exit. Example This example prevents the CETerm exit if any session is connected.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Syntax function OnProgramStart ( ) This handler has no arguments and any return value is ignored. Example This example makes sure Session 3 is active when CETerm starts. /* OnProgramStart */ function OnProgramStart ( ) { // Allways switch to Session 3 CETerm.PostIDA( "IDA_SESSION_S3", 0 ); } 4.10 THE ONSERIALPORTEVENT EVENT The OnSerialPortEvent event is fired when a serial port changes state.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 4.11 THE ONSESSIONCONNECT EVENT The OnSessionConnect event is fired when a session initially connects to the specified host. The handler can be used to initiate an automated login using the “expect” script and “ExpectMonitor” class. Syntax function OnSessionConnect ( session ) session – index of session which connected. Example An example using OnSessionConnect to start the automated login was shown above in Section 2.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Syntax function OnSessionDisconnect ( session ) session – index of session which was disconnected by user. Example This example will switch to the next connected session when the current session is disconnected. If there are no other connected sessions, then CETerm will exit. /* OnSessionDisconnect */ function OnSessionDisconnect ( session ) { // Switch to next connected session CETerm.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE { // Check RF status var status = CETerm.GetProperty ( "device.rf.status" ); if (status <= 0) { OS.Alert( "No RF signal detected.\n" + "Return to RF coverage and reconnect." ); return; } // Attempt to reconnect to host CETerm.PostIDA( "IDA_SESSION_CONNECT", session ); } 4.14 THE ONSESSIONRECEIVE EVENT The OnSessionReceive event is fired when a terminal emulation session receives data from the connected host.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 4.15 THE ONSESSIONSWITCH EVENT The OnSessionSwitch event is fired when the active session changes. The handler can be used to perform a session specific action. Syntax function OnSessionSwitch ( session, previousSession ) session – index of session which became active. previousSession – index of session which was previously active.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Syntax function OnStylusDown ( session, row, column ) session – index of currently active session row – row of screen tap column – column of screen tap. Example Several samples for OnStylusDown were given in Section 2.7. Following is an example that starts a barcode scan if the row contains the word “scan”. Not all hardware devices support a scan trigger by script.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Example This example activates a corresponding trigger handling function in the current browser session. /* OnTriggerEvent */ function OnTriggerEvent( flags, id ) { var index = CETerm.ActiveSession; var Session = CETerm.Session(index); if (Session.Browser.Document != null) { // Current session is browser session. // Hand off processing to web page. var script = "OnTriggerEvent("+ flags + "," + id + ");"; Session.Browser.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE /* OnVTCommand */ function OnVTCommand( session, command, arg1, arg2, arg3, arg4 ) { if (command === "PM") { // Format: PM text ST or ESC ^ text ESC \ // arg1 contains a text string // Other args are undefined if (arg1.charAt(0) === "1") { // Reply with special text CETerm.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Example This example will wait for RF coverage to resume and sound a tone when it is available. While waiting, a “tic” sound will be made periodically to indicate the check. This sample is more complex than needed, but it illustrates how to use global variables and timers to periodically check state.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE if (rfStatus > 0) { // RF detected // Delayed playsound, increase delay for WEP if needed CETerm.SetTimeout( "RFWakeupSoundPlay();", 100 ); RFWakeupSoundContinue = 0; } else if (RFWakeupSoundCount > RFWakeupSoundCountMaximum) { // Failed to get RF, show failure message. OS.Alert( "Failed to detect RF signal.\n" + "Return to coverage area.
5.0 Scripting Techniques and Tips This section describes ways that scripting can extend the capabilities of CETerm. Tips for script development are also presented. 5.1 EXPECT AND EXPECTMONITOR FOR AUTOMATING TASKS The “expect” script and “ExpectMonitor” class provide a general purpose “prompt-and-response” tool. Using “expect” for automated login was described in Section 2.6. Here we provide the complete listing of the scripts and discuss other options for use. 5.1.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE //EM.OnDone = function (success) { OS.Alert( "Done." ) }; // Start check EM.Start(); } 5.1.2 ExpectMonitor Class The “ExpectMonitor” class illustrates the use of a prototype in JavaScript. This class also manages all instances of itself to restrict the number of objects that can be created. /* // // // // // // // ExpectMonitor */ ExpectMonitor class The ExpectMonitor class manages the expect/action sequence for a session.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE function ExpectMonitor_Check() { // Clear timer id this.timer = null; // If something to check for, check it. var target = this.args[this.state]; if (target != null) { // Get all screen text var screenText = CETerm.Session(this.session).Screen.GetText (1,1,-1,-1); if (screenText != null && screenText.match( target )) { // Found match var action = this.args[this.state + 1]; this.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Run any post-execution actions if (typeof this.OnDone == "function") { this.OnDone( true ); } } } else { // No match, schedule again if (this.checkCount++ < this.maxCheckCount) { this.Schedule(); } else { if (!this.silent) { OS.Alert( "Expect failed to find text \"" + target + "\"" ); } if (typeof this.OnDone == "function") { // Done but failed this.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE function ExpectMonitor_Abort() { // Stop any timer if (this.timer != null) { CETerm.ClearTimeout( this.timer ); this.timer = null; } // Set state to beyond reasonable range this.state = 1000; } // Method definitions ExpectMonitor.prototype.Check = ExpectMonitor_Check; ExpectMonitor.prototype.Schedule = ExpectMonitor_Schedule; ExpectMonitor.prototype.Start = ExpectMonitor_Start; ExpectMonitor.prototype.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE This script can be entered into any script slot and bound to a key combination for activation. You must also load the “expect” and “ExpectMonitor” in a script slot which is marked “Load at Startup” so that the functions are available for use. 5.2 PRESENTING VISUAL FEEDBACK DURING SCRIPT EXECUTION The Message object can be displayed during script execution when you want to provide a visual indication of script progress.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE m.Progress = 0; m.IsVisible = true; OS.Sleep( 2000 ); // Simulate work delay // Update m.Progress = 20; m.Text = "Finding addresses, please wait."; OS.Sleep( 2000 ); // Simulate work delay // Update m.Progress = 50; m.Text = "Sorting addresses, please wait."; OS.Sleep( 2000 ); // Simulate work delay // Update m.Progress = 90; m.Text = "Almost done, please wait."; OS.Sleep( 2000 ); // Simulate work delay // Done m.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 5.4 RUNNING AN EXTERNAL PROGRAM It is possible to start an external program from the CETerm script engine. You can wait for the program to finish or allow it to run independently. Often you will run a program then return to CETerm when it exits. The Process object allows you to manage running processes. The Event object can be used to schedule a script to run when a process exits.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE { // Resume online inventory, and save cached // data to file in background. CETerm.SetTimeout( "BackgroundSave(" + session + ");", 10 ); } } /* BackgroundSave */ function BackgroundSave( session ) { var d = new ActiveXObject( "Microsoft.XMLDOM" ); d.loadXML( "" + "Beginning XML" + "Mastering XML" + ""); if (!OS.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE { status = F.Write( filename, addedContent ); } return status; } 5.7 ACCESSING THE REGISTRY The registry on a Windows CE device is a form of database which contains most of the device configuration. The Registry automation object allows you to read, write and delete registry keys and values. WARNING: Altering the registry can make your device unusable.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE OS.Alert( "Failed to confirm write of " + fullyQualifiedKey ); } return status; } NewRegistryDWORD may be used as follows. // Write a new value NewRegistryDWORD( "SOFTWARE\\Naurtech\\Test", "TestDword", 510 ); 5.8 CONTROLLING A SERIAL PORT FROM CETERM This section describes how to control serial ports with scripting in CETerm. Both real (e.g., “COM1:”) and virtual (e.g.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE The SerialPort objects are obtained from the root Device object by specifying the desired index: var index = 0; var sp = Device.SerialPort( index ); where sp is the reference to the SerialPort object. It is a good practice to use a local variable to hold the reference inside a function when multiple port operations must be performed. 5.8.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 5.8.3.1 Configuring SerialPort Timeouts When reading from the serial port, the default timeouts prevent blocking of the read operation. Most reads should be performed in response to an EV_RXCHAR event indicating that data is available from the attached device. Often however, some timeout is needed to allow a complete data message to be received.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var sp = Device.SerialPort( portIndex ); // Port configuration sp.EventMask = EV_RXCHAR | EV_DSR; sp.XOFFOutputFlowControl = false; sp.XOFFInputFlowControl = false; // See Appendix 4 for contants sp.BaudRate = CBR_9600; sp.DataBits = 8; sp.StopBits = ONESTOPBIT; sp.ParityMode = NOPARITY; // Set read timeouts sp.ReadTotalTimeoutConstant = 100; sp.ReadIntervalTimeout = 50; sp.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE You must also define an OnSerialPortEvent handler that will be called when the event occurs. Here is a sample handler: // Serial port event handler function OnSerialPortEvent( portIndex, eventMask ) { if (portIndex === 5) { if (eventMask & EV_RXCHAR) { // Data is available, read and process MyReadAndProcess( portIndex ); } if (eventMask & EV_DSR) { // DSR state changed.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 5.8.5 Using Single Byte Reads One pattern which often works well for handling serial port data is to read a single byte at a time and to accumulate data until a “complete message” can be processed. Your application and peripheral device will define what a “complete message” contains, but often messages are terminated by special characters such as ASCII ETX.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE default: if (responseState === "DATA") { // Save character responseData.push( String.fromCharCode( c ) ); } break; } } if (responseState === "DONE") { // Process message // Maybe schedule another data detection after processed. MyProcessMessage( responseData ); responseState = "PRE_STX"; } else { // Schedule another data detection to complete message sp.WaitForEvent(); } } 5.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE JavaScript uses “garbage collection” to reclaim memory no longer in use. Memory occupied by global variables may never be reclaimed, whereas local variable memory can be reclaimed after a function call completes. Because the JavaScript engine in CETerm is not reset frequently like a browser JavaScript engine, it is more likely that poor programming practices could exhaust memory. 5.9.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE 5.9.3 Limit Execution Time Because the script engine acts like a “virtual user”, when a script is executing, CETerm will seem unresponsive. You cannot have a script running continuously. However, using events and timers, you can accomplish any task. Do not disable the “Script Timeout” unless you are sure your script will not enter an infinite loop. 5.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE [Line: 14 Col: 9] Object doesn’t support this property or method. Unfortunately, the JScript engine does not return the source code line for a runtime error. You must manually examine your scripts at the specified location for a clue about the problem. 5.10.2 OS.Alert() Because there is no JScript debugger on the Windows CE device, the tried-andtrue debugging tool is “OS.Alert( message )”.
Appendix 1 - IDA Action Codes Many IDA codes apply only to a Terminal Emulation session. Some IDA codes can only be used in restricted circumstances, such as IDA_URL.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name IDA_AT IDA_A IDA_B … IDA_Z @ A B … Z IDA_LEFT_BRACKET IDA_BACKSLASH IDA_RIGHT_BRACKET IDA_CARET IDA_UNDERSCORE IDA_BACKTICK IDA_a IDA_b … IDA_z [ \ ] ^ _ ` a b … z IDA_LEFT_BRACE IDA_PIPE IDA_RIGHT_BRACE IDA_TILDE IDA_DEL { | } ~ DEL C1 ASCII Controls IDA_IND IDA_NEL IDA_HTS IDA_RI IDA_SS2 IDA_SS3 IDA_DCS IDA_PU1 IDA_PU2 IDA_CSI IDA_ST IDA_OSC IDA_PM IDA_APC Index Next Line Horiz Tab Set Re
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name Description IDA_INHIBIT_UPDATE IDA_UNINHIBIT_UPDATE IDA_UPDATE IDA_INHIBIT_SEND IDA_UNINHIBIT_SEND IDA_SEND_PENDING Inhibit Update Uninhibit Update Update Inhibit Send Uninhibit Send Send Pending Chars Don‟t update display Allow display update Force display update VT buffer characters VT stop buffering VT send buffered chars IDA_PROGRAM_ABOUT IDA_PROGRAM_EXIT IDA_PROGRAM_EXITSILENT IDA_PROGRAM
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name Description IDA_SESSION_S4 Session 4 Switch to session 4 IDA_TOOLBAND_HIDE IDA_TOOLBAND_TOGGLEHIDE IDA_KEYBAR_HIDE IDA_KEYBAR_TOGGLEHIDE IDA_KEYBAR_LEFT Hide ToolBar Toggle ToolBar Hide KeyBar KeyBar Toggle Prev KeyBar IDA_KEYBAR_RIGHT Next KeyBar Hide full Toolbar Toggle Toolbar visibility Hide KeyBar Toggle KeyBar visibility Switch to previous KeyBar Switch to next KeyBar IDA_KEYBAR_SEP
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name Description IDA_SLEEP_200 IDA_SLEEP_1000 IDA_SLEEP_5000 IDA_SLEEP_20000 IDA_SLEEP_100000 Sleep 200msec Sleep 1sec Sleep 5sec Sleep 20sec Sleep 100sec IDA_SCAN_RESUME IDA_SCAN_SUSPEND IDA_SCAN_TRIGGER Scan Resume Scan Suspend Scan Trigger Allow scanning Suspend scanning Soft trigger scanner IDA_MACRO_OPEN IDA_MACRO_CLOSE IDA_MACRO_TOGGLEHIDE Macro Show Macro Hide Macro Toggle IDA_MACRO_RECO
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name IDA_IBM_HOME IDA_DELETE IDA_INSERT_ON IDA_INSERT_OFF IDA_INSERT_TOGGLE IDA_ATTN IDA_CLEAR IDA_CURSOR_SELECT IDA_DUP IDA_ERASE_EOF IDA_ERASE_INPUT IDA_FIELD_MARK IDA_NEWLINE IDA_PA1 IDA_PA2 IDA_PA3 IDA_RESET IDA_SYSREQ IBM Home Delete Insert On Insert Off Insert Toggle Attn Clear Cursor Select DUP Erase EOF Erase Input Field Mark Newline PA1 PA2 PA3 Reset Sys Request Description 5250 Specific Ac
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name IDA_REMOVE IDA_SELECT IDA_VT_PF1 IDA_VT_PF2 IDA_VT_PF3 IDA_VT_PF4 IDA_VT_COMMA IDA_NUMPAD_0 IDA_NUMPAD_1 IDA_NUMPAD_2 IDA_NUMPAD_3 IDA_NUMPAD_4 IDA_NUMPAD_5 IDA_NUMPAD_6 IDA_NUMPAD_7 IDA_NUMPAD_8 IDA_NUMPAD_9 IDA_VT_ENTER IDA_VT_MINUS IDA_VT_PERIOD Remove Select VT PF1 VT PF2 VT PF3 VT PF4 Numpad Comma Numpad 0 Numpad 1 Numpad 2 Numpad 3 Numpad 4 Numpad 5 Numpad 6 Numpad 7 Numpad 8 Numpad 9 Numpa
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name IDA_VT_CSI_Q IDA_VT_CSI_R IDA_VT_CSI_S IDA_VT_CSI_T VT CSI Q VT CSI R VT CSI S VT CSI T Description Windows App Keys IDA_APPKEY_K1 IDA_APPKEY_K2 … IDA_APPKEY_K16 App Key 1 App Key 2 … App Key 16 IDA_SCROLL_UPPERLEFT IDA_SCROLL_UPPERRGHT IDA_SCROLL_LOWERLEFT IDA_SCROLL_LOWERRGHT IDA_SCROLL_CENTER IDA_SCROLL_CURSOR_CENTER IDA_SCROLL_CURSOR_VISIBLE Scroll Upper Left Scroll Upper Right Scroll Lo
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Friendly Name IDA_IM_KEYBOARD IDA_IM_LOCKED IM Keyboard IM Locked Description HTML Actions IDA_URL_HOME IDA_URL_BACK IDA_URL URL Home URL Back URL Defines start of URL Special Actions IDA_VIBRATE_100 IDA_VIBRATE_200 IDA_VIBRATE_500 IDA_VIBRATE_1000 IDA_VIBRATE_2000 IDA_VIBRATE_5000 Vibrate 100ms Vibrate 200ms Vibrate 500ms Vibrate 1sec Vibrate 2sec Vibrate 5sec IDA_BEEP_OK IDA_BEEP_WARN IDA_BEEP_LOUD B
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Appendix 2 - Properties The properties listed in this appendix may be accessed via the GetProperty and SetProperty methods on the CETerm object. Properties marked (RO) are readonly and may not be set with SetProperty. The symbol T/F indicates a true or false value. APPLICATION PROPERTIES Property Name Description app.buildid (RO) app.commandline (RO) app.name (RO) app.script.NN app.session.active (RO) app.usertext.NN app.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Property Name Description device.presetid (RO) device.rf.strength (RO) Windows CE Preset ID RF signal strength 0-100, -2 – not associated with AP, -1 – unknown RF status -1 – unknown, 0 – unassociated, 1 – poor, 2 – fair, 3 – good, 4 – very good, 5 – excellent Device serialnumber device.rf.status (RO) device.serialnumber (RO) SESSION PROPERTIES Session properties begin with “sessionX” where X is 1 through 4.
SCANNER PROPERTIES Scanner properties are unique for each session. Scanner properties begin with “sessionX.scanner” where X is 1 through 4. For example “session4.scanner.enabled”. If no „X‟ value is found, the currently active session number is used. We use the name “scanner” for all types of barcode readers, including laser scanners and imagers. If a hardware vendor is listed, the property is specific to barcode readers made by that vendor.
COMMON SYMBOLOGY PROPERTIES Symbology properties are unique for each session. Symbology properties begin with “sessionX.scanner.SSS” where X is 1 through 4 and SSS represents a symbology name and may be 3 or more characters long. For example “session4.scanner.upca.enabled”. If no „X‟ value is found, the currently active session number is used. See the Symbology Names table below for SSS values. NOTE: If you are changing the scanner properties for the currently activesession, you must call CETerm.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE CODABAR SYMBOLOGY PROPERTIES Codabar specific symbology properties are unique for each session. Symbology properties begin with “sessionX.scanner.codabar” where X is 1 through. For example “session4.scanner.codabar.clsiediting”. If no „X‟ value is found, the currently active session number is used. NOTE: If you are changing the symbology properties for the currently active session, you must call “CETerm.
CODE39 SYMBOLOGY PROPERTIES Code 39 specific symbology properties are unique for each session. Symbology properties begin with “sessionX.scanner.code39” where X is 1 through. For example “session4.scanner.code39.clsiediting”. If no „X‟ value is found, the currently active session number is used. NOTE: If you are changing the symbology properties for the currently active session, you must call “CETerm.PostIDA( “IDA_SCAN_APPLYCONFIG”, 0 ) for the changes to take effect.
CODE 128 SYMBOLOGY PROPERTIES Code 128 specific symbology properties are unique for each session. Symbology properties begin with “sessionX.scanner.code128” where X is 1 through. For example “session4.scanner.code128.ISBT”. If no „X‟ value is found, the currently active session number is used. NOTE: If you are changing the symbology properties for the currently active session, you must call “CETerm.PostIDA( “IDA_SCAN_APPLYCONFIG”, 0 ) for the changes to take effect.
UPC-EAN GENERAL SYMBOLOGY PROPERTIES UPC-EAN general symbology properties are unique for each session. Symbology properties begin with “sessionX.scanner.upc-ean” where X is 1 through. For example “session4.scanner.upc-ean.bookland”. If no „X‟ value is found, the currently active session number is used. NOTE: If you are changing the symbology properties for the currently active session, you must call “CETerm.PostIDA( “IDA_SCAN_APPLYCONFIG”, 0 ) for the changes to take effect.
SYMBOLOGY NAMES Symbology properties begin with “sessionX.scanner.SSS” where X is 1 through 4 and SSS represents a symbology name and may be 3 or more characters long. The following table lists all available symbology names. WARNING: Not all symbologies are applicable to all hardware. Different devices may use different names to refer to similar symbologies, e.g., upce and upce0. You should look at the symbologies available in the CETerm configuration dialogs to determine the correct name.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbology Name Description maxicode mesa micropdf msi pdf pdf417 pharma39 planet plessey posicode postnet qrcode rss rss14 rssexp rsslim rssltd telepen tlc39 trioptic39 ukpostal upca upce upce0 upce1 upc-ean usplanet uspostnet usps4cb Maxicode Mesa Micro PDF MSI PDF 417 PDF 417 Pharma 39 Planet Plessey Posicode Postnet QR Code RSS 14 RSS 14 RSS Expanded RSS Limited RSS Limited Telepen TLC 39 Trioptic 39 British (UK) Postal
Appendix 3 – Symbology LabelTypes This appendix contains a list of symbology labeltypes that are returned in the “type” argument of OnBarcodeRead. These are also available to a ScannerNavigate META tag handler. Please note that not all hardware devices return these values. You may need to test scan a known barcode to find the labeltype value for that barcode.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE LabelType Character Hexadecimal Value @ A B C D E F G H I J K L M N 0x40 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4A 0x4B 0x4C 0x4D 0x4E PDF 417 ISBT 128 Trioptic 39 Coupon Code Bookland Micro PDF Code 32 Macro PDF Maxicode Datamatrix QR Code Macro Micro PDF RSS-14 RSS Limited RSS Expanded V W X 0x56 0x57 0x58 Composite AB Composite C TLC 39 a b c d e f g 0x61 0x62 0x63 0x64 0x65 0x66 0x67 US Postnet US Planet
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Appendix 4 - Constants This appendix contains various constants that are used by CETerm Automation Objects. Many of these constants are a direct representation of the equivalent values from the Windows CE system APIs and constants. These constants are mostly presented as global JavaScript variables for direct inclusion in scripts.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var var var var var var BATTERY_CHEMISTRY_NICD BATTERY_CHEMISTRY_NIMH BATTERY_CHEMISTRY_LION BATTERY_CHEMISTRY_LIPOLY BATTERY_CHEMISTRY_ZINCAIR BATTERY_CHEMISTRY_UNKNOWN // Power State var POWER_STATE_UNKNOWN var POWER_STATE_FULL_ON var POWER_STATE_LOW_POWER_ON var POWER_STATE_STANDBY var POWER_STATE_SLEEP var POWER_STATE_OFF = = = = = = = = = = = = 0x02; 0x03; 0x04; 0x05; 0x06; 0xFF; -1; 0; 1; 2; 3; 4; // // // // // //
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // Attempt to redirect the navigation failed. var INET_E_REDIRECT_FAILED = 0x800C0014; // Navigation redirected to a directory. var INET_E_REDIRECT_TO_DIR = 0x800C0015; // Unable to lock request with the server. var INET_E_CANNOT_LOCK_REQUEST = 0x800C0016; // Reissue request with extended binding. var INET_E_USE_EXTEND_BINDING = 0x800C0017; // Binding is terminated.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE KEYBOARD CONSTANTS // Constants used by OnKeyboardStateChange var IBM_KEYBOARD_HARDWARE_ERROR = 0; var IBM_KEYBOARD_NORMAL_LOCKED = 1; var IBM_KEYBOARD_NORMAL_UNLOCKED = 2; var IBM_KEYBOARD_POWER_ON = 3; var IBM_KEYBOARD_PRE_HELP_ERROR = 4; var IBM_KEYBOARD_POST_HELP_ERROR = 5; var IBM_KEYBOARD_SS_MESSAGE = 6; var IBM_KEYBOARD_SYSTEM_REQUEST = 7; var VT_KEYBOARD_LOCKED = 1; var VT_KEYBOARD_UNLOCKED = 2; // Keyboard Hotkey Cons
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE KeyShiftNoCharacterFlag : 0x00010000, // No corresponding char. KeyShiftNumLockFlag KeyShiftScrollLockFlag }; : 0x00001000, // : 0x00000800 // NumLock toggled state. ScrollLock toggled state. MESSAGEBOX CONSTANTS // MessageBox flags // See Microsoft SDK for documentation.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var var var var PLAYSOUND_FLAG_NODEFAULT = 0x00000002; // No default sound PLAYSOUND_FLAG_LOOP = 0x00000008; // Repeat play, needs ASYNC.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE SERIAL PORT CONSTANTS // Constants for SerialPort control object // // DTR Control Flow Values.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var CBR_128000 var CBR_256000 = 128000; = 256000; // // Error Flags // var CE_RXOVER var CE_OVERRUN var CE_RXPARITY var CE_FRAME var CE_BREAK var CE_TXFULL var CE_PTO var CE_IOE var CE_DNS var CE_OOP var CE_MODE = = = = = = = = = = = // // Access // var GENERIC_READ var GENERIC_WRITE = 0x80000000; = 0x40000000; // // Events // var EV_RXCHAR var EV_RXFLAG var EV_TXEMPTY var EV_CTS var EV_DSR var EV_RLSD var EV_BREAK var E
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE var CLRDTR = 6; // Set DTR low // Gap for NT code RESETDEV, not supported on CE var SETBREAK = 8; // Set the device break line. var CLRBREAK = 9; // Clear the device break line. // Some devices share a UART between an IRDA port and a serial port. // These escape functions allow control over the mode. var SETIR = 10; // Set the port to IR mode. var CLRIR = 11; // Set the port to non-IR mode. // // Purge mode flags.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE // identifies the sibling window below the specified window. HWNDPREV : 0x3, // The window above the specified window in the z-order. // If the specified window is a topmost window, the handle // identifies the topmost window above the specified window. // If the specified window is a child window, the handle // identifies the sibling window above the specified window.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Appendix 5 – Microsoft Virtual-Key (VK) Codes This appendix lists the standard Microsoft Virtual-Key codes. These codes are sent to applications when keys are pressed. Most devices generate only a small subset of these codes, depending on the hardware keyboard. Some VK codes are not applicable to Windows CE but are listed for completeness.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Value VK_UP VK_RIGHT VK_DOWN VK_SELECT VK_PRINT VK_EXECUTE VK_SNAPSHOT VK_INSERT VK_DELETE VK_HELP 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U 0x26 0x27 0x28 0x29 0x2A 0x2B 0x2C 0x2D 0x2E 0x2F 0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x41 0x42 0x43 0x44 0x45 0x46 0x47 0x48 0x49 0x4A 0x4B 0x4C 0x4D 0x4E 0x4F 0x50 0x51 0x52 0x53 0x54 0x55 CETerm Scripting Guide Page 154
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Value V W X Y Z VK_LWIN VK_RWIN VK_APPS VK_SLEEP VK_NUMPAD0 VK_NUMPAD1 VK_NUMPAD2 VK_NUMPAD3 VK_NUMPAD4 VK_NUMPAD5 VK_NUMPAD6 VK_NUMPAD7 VK_NUMPAD8 VK_NUMPAD9 VK_MULTIPLY VK_ADD VK_SEPARATOR VK_SUBTRACT VK_DECIMAL VK_DIVIDE VK_F1 VK_F2 VK_F3 VK_F4 VK_F5 VK_F6 VK_F7 VK_F8 VK_F9 VK_F10 VK_F11 VK_F12 VK_F13 VK_F14 VK_F15 VK_F16 0x56 0x57 0x58 0x59 0x5A 0x5B 0x5C 0x5D 0x5F 0x60 0x61 0x62 0x63 0x64 0x65 0x66 0x67 0
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Value VK_F17 VK_F18 VK_F19 VK_F20 VK_F21 VK_F22 VK_F23 VK_F24 VK_NUMLOCK VK_SCROLL VK_LSHIFT VK_RSHIFT VK_LCONTROL VK_RCONTROL VK_LMENU VK_RMENU VK_BROWSER_BACK VK_BROWSER_FORWARD VK_BROWSER_REFRESH VK_BROWSER_STOP VK_BROWSER_SEARCH VK_BROWSER_FAVORITES VK_BROWSER_HOME VK_VOLUME_MUTE VK_VOLUME_DOWN VK_VOLUME_UP VK_MEDIA_NEXT_TRACK VK_MEDIA_PREV_TRACK VK_MEDIA_STOP VK_MEDIA_PLAY_PAUSE VK_LAUNCH_MAIL VK_LAUNCH_ME
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Symbolic Name Value VK_OEM_4 VK_OEM_5 VK_OEM_6 VK_OEM_7 VK_OEM_8 VK_OEM_AX VK_OEM_102 VK_PROCESSKEY VK_PACKET VK_DBE_ALPHANUMERIC VK_DBE_KATAKANA VK_DBE_HIRAGANA VK_DBE_SBCSCHAR VK_DBE_DBCSCHAR VK_DBE_ROMAN VK_ATTN VK_CRSEL VK_EXSEL VK_EREOF VK_PLAY VK_ZOOM VK_NONAME VK_PA1 VK_OEM_CLEAR 0xDB 0xDC 0xDD 0xDE 0xDF 0xE1 0xE2 0xE5 0xE7 0xF0 0xF1 0xF2 0xF3 0xF4 0xF5 0xF6 0xF7 0xF8 0xF9 0xFA 0xFB 0xFC 0xFD 0xFE CETerm Scripting G
Glossary Automation Objects Objects internal to CETerm that provide access to device, application, and session features from the script engine. CEBrowseX A Naurtech ActiveX control which provides access to the CETerm Automation Objects from a Windows Mobile device. external This is the name of an internal object in the DOM of the Windows CE 5.0 browser that gives access to the CETerm Automation Objects.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Index A AbortButtonVisible · 61 AbortScript · 26 ActiveSession · 30 AddMetaItem · 37, 84, 85, 96 Alert · 33 Append · 43 ASCIIMode · 49 AssignHotKey · 56 B Battery Constants · 143 BaudRate · 73 Beep · 33 Browser Error Constants · 144 Browser object · 37 Browser.AddMetaItem · 37 Browser.DocLoaded · 38 Browser.Document · 38 Browser.Navigate · 37 Browser.RunScript · 37 C CancelWaitForEvent · 70 CETerm object · 25 CETerm.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE E Enable (Keyboard) · 57 EnableInput · 78 EnumerateKeys · 66 EnumerateValues · 66 Event object · 35, 38 Event.ClearAllListeners · 39 Event.ClearListener · 39 Event.Create · 39 Event.Delete · 40 Event.DeleteAllEvents · 40 Event.GetHandlerScript · 40 Event.GetList · 40 Event.GetName · 41 Event.IsExistingEvent · 41 Event.IsListenerSet · 41 Event.LastError · 42 Event.Pulse · 41 Event.Reset · 41 Event.Set · 41 Event.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE GPS.LastPosition · 53 GPS.MaximumAge · 53 GPS.NewLocationDataEvent · 53 GPS.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Network.LastPingHostName · 62 Network.LastPingIPAddress · 62 Network.LastWSAError · 62 Network.MaximumPingTimeout · 62 Network.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Reset (Event) · 41 ResetIdleTimer · 31 RFID object · 32 Rows · 68 RTSControlMode · 74 RunScript · 27, 37, 84 S ScannerNavigate · 17 Screen object · 67 Screen.Columns · 68 Screen.CrosorRow · 68 Screen.CursorColumn · 68 Screen.DisplayStatus · 68 Screen.GetText · 68 Screen.GetTextLine · 68 Screen.GetTextRect · 68 Screen.KeyboardState · 68 Screen.Rows · 68 Screen.
NAURTECH W EB BROWSER AND TERMINAL EMULATION FOR W INDOWS CE AND W INDOWS MOBILE Title · 61, 77 Trigger object · 32 U UserName · 50 V Vibrate · 32 Virtual-Key Codes · 153 VK Codes · 153 W WaitForEvent · 72 WaitForExit · 64 Window Constants · 151 Window object · 36, 77 Window.EnableInput · 78 Window.Find · 78 Window.GetDesktop · 78 Window.GetList · 78 Window.GetParent · 79 Window.GetRelative · 79 Window.GetSelf · 79 CETerm Scripting Guide Window.GetText · 79 Window.GetTopmost · 79 Window.