<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2017  STMicroelectronics – All rights reserved
  ~ The STMicroelectronics corporate logo is a trademark of STMicroelectronics
  ~
  ~ Redistribution and use in source and binary forms, with or without modification,
  ~ are permitted provided that the following conditions are met:
  ~
  ~ - Redistributions of source code must retain the above copyright notice, this list of conditions
  ~   and the following disclaimer.
  ~
  ~ - Redistributions in binary form must reproduce the above copyright notice, this list of
  ~   conditions and the following disclaimer in the documentation and/or other materials provided
  ~   with the distribution.
  ~
  ~ - Neither the name nor trademarks of STMicroelectronics International N.V. nor any other
  ~   STMicroelectronics company nor the names of its contributors may be used to endorse or
  ~   promote products derived from this software without specific prior written permission.
  ~
  ~ - All of the icons, pictures, logos and other images that are provided with the source code
  ~   in a directory whose title begins with st_images may only be used for internal purposes and
  ~   shall not be redistributed to any third party or modified in any way.
  ~
  ~ - Any redistributions in binary form shall not include the capability to display any of the
  ~   icons, pictures, logos and other images that are provided with the source code in a directory
  ~   whose title begins with st_images.
  ~
  ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
  ~ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  ~ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
  ~ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  ~ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  ~ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  ~ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  ~ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  ~ OF SUCH DAMAGE.
  -->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:key="MAIN_ROOT_PREFF_KEY">
    <PreferenceCategory
        android:title="Node general settings"
        android:key="DEVICE_GENERAL_SETTINGS_KEY">
    <EditTextPreference
        android:key="DEVICE_LOCAL_NAME"
        android:title="Local Name"
        android:summary="Modify the Bluetooth Low Energy name"
        android:persistent="false"
        />
    <EditTextPreference
        android:key="DEVICE_PUB_ADDR"
        android:title="Public Address"
        android:summary="Modify the Bluetooth Low Energy public address [xx:xx:xx:xx:xx:xx]"
        android:defaultValue="26:80:E1:00:00:00"
        android:persistent="false"/>
    <Preference
        android:key="DEVICE_FW_VERSION"
        android:title="Firmware Version"
        android:summary="NA"
        android:persistent="false"
        android:editable="false"/>
    <Preference
        android:key="DEVICE_BLUENRG_INFO"
        android:title="BlueNRG Info"
        android:summary="NA"
        android:persistent="false"
        android:editable="false"/>
    </PreferenceCategory>


    <PreferenceCategory
        android:title="Session settings"
        android:key="SESSION_GROUP_KEY">
        <ListPreference
            android:key="DEVICE_LED_CONFIG_S"
            android:title="Led Configuration"
            android:summary="Set led configuration"
            android:entries="@array/led_config"
            android:entryValues="@array/led_config_values"
            android:persistent="false"/>
        <EditTextPreference
            android:key="DEVICE_TIMER_FREQ_S"
            android:title="Timer (Hz)"
            android:summary="Modify the basic data output timer frequency"
            android:defaultValue="50"
            android:persistent="false"
            android:inputType="number"/>

        <com.st.BlueMS.demos.wesu.preferences.LocalMultiSelectListPreference
            android:key="DEVICE_DATA_READ_GROUP_A_S"
            android:title="Data Read GROUP A"
            android:summary="Enable disable data to read"
            android:entries="@array/data_read_group_a"
            android:entryValues="@array/data_read_group_a_values"
            android:defaultValue="@array/empty_array"
            android:persistent="false"/>
        <com.st.BlueMS.demos.wesu.preferences.LocalMultiSelectListPreference
            android:key="DEVICE_DATA_READ_GROUP_B_S"
            android:title="Data Read GROUP B"
            android:summary="Enable disable data to read"
            android:entries="@array/data_read_group_b"
            android:entryValues="@array/data_read_group_b_values"
            android:defaultValue="@array/empty_array"
            android:persistent="false"/>
        <PreferenceScreen
            android:title="Features Settings"
            android:key="DEVICE_FEATURES_CONTROL_SETTINGS_S"
            android:summary="Control configuration for available features"
            >
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0080_S"
                android:title="Accelerometer, Gyroscope, Magnetometer"
                android:summary="NA"
                android:persistent="false"
                android:editable="true"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0010_S"
                android:title="Pressure"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0004_S"
                android:title="Temperature"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0002_S"
                android:title="Battery"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <!--<Preference-->
                <!--android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0001_S"-->
                <!--android:title="Pedometer"-->
                <!--android:summary="NA"-->
                <!--android:persistent="false"-->
                <!--android:editable="false"/>-->
            <!--<Preference-->
                <!--android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0080_S"-->
                <!--android:title="Sensor Fusion Mems"-->
                <!--android:summary="NA"-->
                <!--android:persistent="false"-->
                <!--android:editable="false"/>-->
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0100_S"
                android:title="Motion FX"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0200_S"
                android:title="FreeFall (deprecated)"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0400_S"
                android:title="Accelerometer Events"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0010_S"
                android:title="Activity Recognition"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0008_S"
                android:title="Carry Position"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
        </PreferenceScreen>
        <ListPreference
            android:key="DEVICE_LOW_POWER_S"
            android:title="Power Mode"
            android:summary="Set Power Mode Options"
            android:entries="@array/pwr_mode_config"
            android:entryValues="@array/pwr_mode_config_values"
            android:persistent="false"/>

    </PreferenceCategory>
    <PreferenceCategory
        android:title="Persistent settings"
        android:key="PERSISTENT_GROUP_KEY">

        <ListPreference
            android:key="DEVICE_LED_CONFIG_P"
            android:title="Led Configuration"
            android:summary="Set led configuration"
            android:entries="@array/led_config"
            android:entryValues="@array/led_config_values"
            android:persistent="false"/>
        <EditTextPreference
            android:key="DEVICE_TIMER_FREQ_P"
            android:title="Timer (Hz)"
            android:summary="Modify the basic data output timer frequency"
            android:defaultValue="50"
            android:persistent="false"
            android:inputType="number"/>

        <com.st.BlueMS.demos.wesu.preferences.LocalMultiSelectListPreference
            android:key="DEVICE_DATA_READ_GROUP_A_P"
            android:title="Data Read GROUP A"
            android:summary="Enable disable data to read"
            android:entries="@array/data_read_group_a"
            android:entryValues="@array/data_read_group_a_values"
            android:defaultValue="@array/empty_array"
            android:persistent="false"/>
        <com.st.BlueMS.demos.wesu.preferences.LocalMultiSelectListPreference
            android:key="DEVICE_DATA_READ_GROUP_B_P"
            android:title="Data Read GROUP B"
            android:summary="Enable disable data to read"
            android:entries="@array/data_read_group_b"
            android:entryValues="@array/data_read_group_b_values"
            android:defaultValue="@array/empty_array"
            android:persistent="false"/>
        <PreferenceScreen
            android:title="Features Settings"
            android:key="DEVICE_FEATURES_CONTROL_SETTINGS_P"
            android:summary="Control configuration for available features"
            >
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0080_P"
                android:title="Accelerometer, Gyroscope, Magnetometer"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0010_P"
                android:title="Pressure"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0004_P"
                android:title="Temperature"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_A_FEATURE_CTRLS_0002_P"
                android:title="Battery"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <!--<Preference-->
                <!--android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0001_P"-->
                <!--android:title="Pedometer"-->
                <!--android:summary="NA"-->
                <!--android:persistent="false"-->
                <!--android:editable="false"/>-->
            <!--<Preference-->
                <!--android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0080_P"-->
                <!--android:title="Sensor Fusion Mems"-->
                <!--android:summary="NA"-->
                <!--android:persistent="false"-->
                <!--android:editable="false"/>-->
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0100_P"
                android:title="Motion FX"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0200_P"
                android:title="FreeFall (deprecated)"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0400_P"
                android:title="Accelerometer Events"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0010_P"
                android:title="Activity Recognition"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
            <Preference
                android:key="DEVICE_GROUP_B_FEATURE_CTRLS_0008_P"
                android:title="Carry Position"
                android:summary="NA"
                android:persistent="false"
                android:editable="false"/>
        </PreferenceScreen>
        <PreferenceScreen
            android:title="Advanced MEMS Settings"
            android:key="DEVICE_ADVANCED_MEMS_SETTINGS"
            android:summary="Expert settings for node MEMS sensors"
            >
            <PreferenceCategory android:title="Accelerometer"
                android:key="ADVANCED_SETTINGS_ACCELEROMETER_KEY">
                <EditTextPreference
                    android:key="ACCELEROMETER_FS_P"
                    android:title="Full Scale (g)"
                    android:summary="FS"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>
                <EditTextPreference
                    android:key="ACCELEROMETER_ODR_P"
                    android:title="Output Data Rate (Hz)"
                    android:summary="ODR"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>

            </PreferenceCategory>
            <PreferenceCategory android:title="Gyroscope"
                android:key="ADVANCED_SETTINGS_GYROSCOPE_KEY">
                <EditTextPreference
                    android:key="GYROSCOPE_FS_P"
                    android:title="Full Scale (dps)"
                    android:summary="FS"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>
                <EditTextPreference
                    android:key="GYROSCOPE_ODR_P"
                    android:title="Output Data Rate (Hz)"
                    android:summary="ODR"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>

            </PreferenceCategory>
            <PreferenceCategory android:title="Magnetometer"
                android:key="ADVANCED_SETTINGS_MAGNETOMETER_KEY">
                <EditTextPreference
                    android:key="MAGNETOMETER_FS_P"
                    android:title="Full Scale (gauss)"
                    android:summary="FS"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>
                <EditTextPreference
                    android:key="MAGNETOMETER_ODR_P"
                    android:title="Output Data Rate (Hz)"
                    android:summary="ODR"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>

            </PreferenceCategory>
            <PreferenceCategory android:title="Pressure"
                android:key="ADVANCED_SETTINGS_PRESSURE_KEY">
                <EditTextPreference
                    android:key="PRESSURE_ODR_P"
                    android:title="Output Data Rate (Hz)"
                    android:summary="ODR"
                    android:defaultValue="0"
                    android:persistent="false"
                    android:inputType="number"/>

            </PreferenceCategory>
        </PreferenceScreen>
        <ListPreference
            android:key="DEVICE_LOW_POWER_P"
            android:title="Power Mode"
            android:summary="Set Power Mode Options"
            android:entries="@array/pwr_mode_config"
            android:entryValues="@array/pwr_mode_config_values"
            android:persistent="false"/>
        <ListPreference
            android:key="DEVICE_BLE_OUTPUT_POWER"
            android:title="BLE Output Power"
            android:summary="Not Available"
            android:entries="@array/ble_output_power"
            android:entryValues="@array/ble_output_power_values"
            android:persistent="false" />
    </PreferenceCategory>

    <PreferenceCategory
        android:title="System"
        android:key="SYSTEM_SETTINGS_KEY">
        <Preference
            android:key="DEVICE_RTC_TIMER"
            android:title="RTC Timer"
            android:summary="Not Available"
            android:entries="@array/rtc_timer"
            android:entryValues="@array/rtc_timer_values"
            android:persistent="false" />
        <ListPreference
            android:key="DEVICE_DFU_S"
            android:title="Device Firmware Upgrade"
            android:summary="Restart node for DFU USB or OTA"
            android:entries="@array/dfu_reboot"
            android:entryValues="@array/dfu_reboot_values"
            android:persistent="false"/>
        <ListPreference
            android:key="DEVICE_POWER_OFF_S"
            android:title="Power-OFF node"
            android:summary="Power-OFF or Restart node"
            android:entries="@array/poweroff_reboot"
            android:entryValues="@array/poweroff_reboot_values"
            android:persistent="false"/>

    </PreferenceCategory>
</PreferenceScreen>