### Navigation

- next
- previous |
- Indy ITK 1.8.0 documentation »

# Stored Settings

Stored settings provides a way for the user to save default key settings to the Indy Modules. On boot up these settings will automatically be loaded in to the specified keys, thereby eliminating the need for the Host to issue any type of set for those keys.

## File Format

The settings XML file has a Settings root with any number of setting sub-elements.

    <?xml version="1.0" ?>
    <Settings>
      <setting>
        <key>E_IPJ_KEY_1</key>
        <bank>0</bank>
        <values>0</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_2</key>
        <bank>0</bank>
        <values>0</values>
      </setting>

      ...

      <setting>
        <key>E_IPJ_KEY_N</key>
        <bank>0</bank>
        <values>0</values>
      </setting>
    </Settings>

### General Guidelines

- Any Key that has Read/Write Permissions can be stored
- Conversely, Read Only keys cannot be stored and should not be included in a settings XML file
- If the Application detects a bad setting then E_IPJ_KEY_LAST_ERROR will be set and the setting will remain at the default value.
- E_IPJ_KEY_LAST_ERROR value_index description:
  - value_index[0] will be set to E_IPJ_ERROR_STORED_SETTING_DECODE
  - value_index[1] will be set to the offending Key code

### Key Requirements

- key is a required tag
- key is the actual IRI Key name, not the numerical Key Id

### Bank Requirements

- bank is a required tag for Keys that have a Bank Count greater than 0
- Conversely, the bank tag is ignored and should be omitted for keys with a Bank Count of 0
- If Bank Count is greater than 0 and bank is not present then a default value of 0 will be used

### Values Requirements

- values is a required tag
- values is a single entry for Keys that have a Value Count of 1
- values is a comma separated list for Keys that have a Value Count greater than 1
- values can support IRI Defines if appropriate for the given key
- values can support hexadecimal entries that have the ‘0x’ prefix
- If Value Count is greater than 1, and not all values are provided in the comma separated list, then all remaining values will automatically be zero-filled
- Invalid entries for values will result in undefined behavior

## Examples

### Simple Auto Start

This example will:

- Demonstrate keys with Value Counts of 1
- Demonstrate keys with Bank Counts of 0 and 1
- Set the region to China
- Set the antenna TX power to 21.00 dBm
- Configure inventory to automatically start when the device boots up

Note

E_IPJ_KEY_ANTENNA_TX_POWER has a Bank Count of 1 so the bank tag is used. The other keys have a Bank Count of 0 so the bank tag is omitted.

    <?xml version="1.0" ?>
    <Settings>
      <setting>
        <key>E_IPJ_KEY_REGION_ID</key>
        <values>E_IPJ_REGION_CHINA_920_925_MHZ</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_ONBOOT_START_ACTION</key>
        <values>E_IPJ_ACTION_INVENTORY</values>
      </setting>
    </Settings>

### Channel Table and GPI Triggering

This example will:

- Demonstrate a key with Value Count greater than 1
- Demonstrate keys with Bank Counts greater than 1
- Demonstrate a comma separated list
- Set the region to Japan
- Set up a custom channel table
- Configure a GPI trigger for starting and stopping inventory

    <?xml version="1.0" ?>
    <Settings>

      <!-- Set up a 3 channel table for Japan -->
      <setting>
        <key>E_IPJ_KEY_REGION_ID</key>
        <values>E_IPJ_REGION_JAPAN_916_921_MHZ_NO_LBT</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_REGION_CHANNEL_TABLE</key>
        <values>6, 18, 12</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_REGION_CHANNEL_TABLE_SIZE</key>
        <values>3</values>
      </setting>

      <!-- Set up a GPI Inventory Start on Port 4 (bank 4) -->
      <setting>
        <key>E_IPJ_KEY_GPIO_MODE</key>
        <bank>4</bank>
        <values>E_IPJ_GPIO_MODE_INPUT_ACTION</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_GPIO_STATE</key>
        <bank>4</bank>
        <values>E_IPJ_GPIO_STATE_LO</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_GPIO_HI_ACTION</key>
        <bank>4</bank>
        <values>E_IPJ_GPI_ACTION_START_INVENTORY</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_GPIO_DEBOUNCE_MS</key>
        <bank>4</bank>
        <values>10</values>
      </setting>

      <!-- Set up a GPI Inventory Stop on Port 1 (bank 1) -->
      <setting>
        <key>E_IPJ_KEY_GPIO_MODE</key>
        <bank>1</bank>
        <values>E_IPJ_GPIO_MODE_INPUT_ACTION</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_GPIO_STATE</key>
        <bank>1</bank>
        <values>E_IPJ_GPIO_STATE_LO</values>
      </setting>
      <setting>
        <key>E_IPJ_KEY_GPIO_HI_ACTION</key>
        <bank>1</bank>
        <values>E_IPJ_GPI_ACTION_STOP_INVENTORY</values>
      </setting>

    </Settings>

Note

In this example GPI triggering will not start until a start command is issued with an E_IPJ_ACTION_GPIO argument

## Creating, Loading and Saving

A stored settings XML file must be converted to a loader image before it can be used. Stored settings loader images are like any other application image and can be loaded as such.

The Indy Demo Tool’s “Image Loader” tab has controls for stored settings.

- A button for saving a stored settings XML file from the attached device, with an optional checkbox to save the loader image as well
- A button for making a loader image binary from a supplied stored settings XML file

Note

To create a stored settings image the Indy Demo Tool must be connected to the IRI device

Note

All values in a settings file that has been saved via the Indy Demo Tool will be in decimal format

### Empty Settings

If the Indy Module does not have any stored settings then using the Indy Demo Tool save settings button will result in a file as follows.

    <?xml version="1.0" ?>
    <Settings/>

- A new Indy Module will be in this state.
- Loading an empty settings is one way to restore factory defaults, as an alternate to the E_IPJ_RESET_TYPE_FACTORY_RESTORE argument to the reset command.

### Navigation

- next
- previous |
- Indy ITK 1.8.0 documentation »