
22
Programming Concepts
Key
Object
Event Handler Property
Any Other Buttons
gui.Form
gui.Menu
gui.Text
onKey
onKey
onKey
3.3.3
Command Execution
The reader application defines a number of commands that can be sent to the firmware
from the host or by reading codes. The reader (section 4.3) defines an event by the
onCommand function. If onCommand is set, the reader finds the specified event before
running the command and transmitting the data.
3.4
Reader Configuration
The configuration settings define the active capabilities of the handheld. The application
development environment defines the
reader
object (section 4.3), which contains
methods for manipulating handheld settings. The Interface Configuration Document
defines the configuration items and the values that can be set for each item.
The application developer can dynamically change the active settings by using the
reader.writeSetting
method. This method changes the operational value of the
setting, but that value is lost when the reader is turned off. The current values of all settings
can be saved by using the
reader.saveSettings
method, which writes the current
values of the settings to flash memory from where they are restored on power up.
Example:
reader.writeSetting(0x1b, 4);
gui.confirm( yesFunc, noFunc, "Setting changed.\n\nSave now? ",
"Setting Change")
//This function will be called if user presses Yes softkey
yesFunc = function() {
if ( !reader.saveSettings() )
alert(postAlertFunc, "Error Saving Settings");
}
Retrieve the current value of a setting by using the
reader.readSetting
method.
Restore factory default settings by using the
reader.defaultSettings
method.