{
  "title": "config",
  "type": "object",
  "properties": {

    "gnssPrettyTrail": {
      "default": false,
      "type": "boolean",
      "description": "Enable automatic location events in order to show pretty trails on the map (causes higher data consumption)"
    },
    "gnssMaxAccuracy": {
      "type": "integer",
      "default": 0,
      "description": "GNSS location accuracy limit (meters, 0 = Filter disabled, 10 = No more than 10m)",
      "enum": [0, 5, 10, 15, 20, 25, 30, 35, 40]
    },
    "gnssAGPS": {
      "type": "boolean",
      "default": false,
      "description": "Enable assisted GPS (useful in cases where the signal is very low)"
    },
    "locationLostTime": {
      "type": "integer",
      "default": 0,
      "description": "Maximum time without a location to trigger the 'unable to receive location' event. (minutes, 0 = event is disabled)",
      "minimum": 0,
      "maximum": 250
    },
    "useStaticLocation": {
      "type": "boolean",
      "default": false,
      "description": "Fallback device location in case a valid location is not available"
    },
    "geoLocationRefreshTime": {
      "type": "integer",
      "default": 1440,
      "description": "How often should we try to get a new location when not moving (minutes)",
      "enum": [0, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "gwPingInterval": {
      "type": "integer",
      "default": 0,
      "description": "How often to send a location to the server (seconds, 0 = disabled)",
      "enum": [0, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "extendedGeoLocation": {
      "type": "boolean",
      "default": false,
      "description": "Transmit extended key/values in gwGeoLocation events"
    },
    "idleReportInterval": {
      "type": "integer",
      "default": 60,
      "description": "How often to connect to the server when neither pixels nor bridges are received (minutes, 0 = disabled)",
      "enum": [0, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "locationSharing": {
      "type": "boolean",
      "default": false,
      "description": "Share location between ERM gateways (when GNSS signal is very low)"
    },
    "useExpiredLocations": {
      "type": "boolean",
      "default": false,
      "description": "Allow using old (expired) locations"
    },

    "networkPolicy": {
      "type": "integer",
      "default": 0,
      "description": "0 = Try to reconnect whenever needed. 1 = Prevent frequent network re-connection",
      "enum": [0, 1]
    },
    "autoRebootNoServer": {
      "type": "integer",
      "default": 720,
      "description": "How long to wait before rebooting when unable to connect to the server (minutes, 0 = disabled)",
      "enum": [0, 15, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "autoRebootNoRx": {
      "type": "integer",
      "default": 0,
      "description": "How long to wait before rebooting when unable to receive any bridge (minutes, 0 = disabled)",
      "enum": [0, 15, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "autoReboot": {
      "type": "integer",
      "default": 0,
      "description": "Automatic reboot interval - unconditional (hours, 0 = disabled)",
      "enum": [0, 6, 12, 18, 24, 36, 48, 72, 120, 144, 168]
    },
    "periodicGatewayInfo": {
      "type": "integer",
      "default": 60,
      "description": "How often to send gateway info when connected to server (minutes, 0 = disabled)",
      "enum": [0, 15, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },
    "transmitManagementPackets": {
      "type": "boolean",
      "default": false,
      "description": "Transmit management packets even when ACL doesn't allow them"
    },
    "accessControlList": {
      "name": "Access Control List",
      "type": "object",
      "description": "Access Control List (ACL) enables Gateways to selectively listen to or ignore pre-defined Bridges. It helps regulate Bridge-to-Gateway communication and reduces unnecessary traffic and associated costs by managing which Bridges connect to the Cloud.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": ["allow", "deny"],
          "default": "deny"
        },
        "bridgeIds": {
          "default": [],
          "type": "array",
          "minItems": 0,
          "maxItems": 64
        }
      }
    },

    "clockUpdateInterval": {
      "type": "integer",
      "default": 1440,
      "description": "Time interval in minutes between clock updates when GNSS is unavailable",
      "enum": [0, 15, 30, 60, 90, 120, 180, 300, 600, 720, 1440, 2880, 4320, 10080]
    },

    "bridgeDetection": {
      "type": "integer",
      "default": 0,
      "description": "How often to send visible bridges in the gwGeoLocation message (minutes, 0 = disabled)",
      "enum": [0, 5, 10, 15, 30, 60, 90, 120, 180, 300, 600, 720, 1440]
    },

    "workWithoutPowerMode": {
      "type": "string",
      "default": "turn_off",
      "description": "Operating mode when main power is lost",
      "enum": ["turn_off","stay_on","low_power"]
    },
    "modemWhenLowPower": {
      "type": "boolean",
      "default": false,
      "description": "Enable modem when working in low power mode"
    },

    "intBridgePower": {
      "type": "string",
      "default": "automatic",
      "description": "Power state of internal bridge",
      "enum": ["automatic","on_powered","on_unpowered","always_on"]
    },

    "movAboveSpeed": {
      "type": "integer",
      "default": 0,
      "description": "Transmit PING event after moving at a speed higher than this (kph, 0 = disabled)",
      "minimum": 0,
      "maximum": 250
    },
    "movMinDuration": {
      "type": "integer",
      "default": 0,
      "description": "Transmit PING event after moving for at least this duration (seconds, 0 = disabled)",
      "minimum": 0,
      "maximum": 250
    },
    "movMinDistance": {
      "type": "integer",
      "default": 0,
      "description": "Minimum distance between movement PING events (meters)",
      "minimum": 0,
      "maximum": 20000
    },
    "movStoppedDuration": {
      "type": "integer",
      "default": 0,
      "description": "Allow another movemnt ping event after parking for at least this duration (minutes)",
      "minimum": 0,
      "maximum": 250
    },

    "dynPacer": {
      "type": "string",
      "default": "disabled",
      "description": "Dynamic pacer mode - pacer is decided accorindg to trip duration or current speed",
      "enum": ["disabled","duration","speed"]
    },
    "dynPacer_PacerStopped": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - pacer interval when stopped",
      "minimum": 0,
      "maximum": 16384
    },
    "dynPacer_Pacer1": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - pacer interval 1",
      "minimum": 0,
      "maximum": 16384
    },
    "dynPacer_Pacer2": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - pacer interval 2",
      "minimum": 0,
      "maximum": 16384
    },
    "dynPacer_Pacer3": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - pacer interval 3",
      "minimum": 0,
      "maximum": 16384
    },
    "dynPacer_Value1": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - duration 1 (minutes) / speed 1 (kph)",
      "minimum": 0,
      "maximum": 250
    },
    "dynPacer_Value2": {
      "type": "integer",
      "default": 0,
      "description": "Dynamic pacer - duration 2 (minutes) / speed 2 (kph)",
      "minimum": 0,
      "maximum": 250
    },

    "movementDetection": {
      "type": "string",
      "default": "automatic",
      "description": "Detection method for movement detection",
      "enum": ["automatic","ignition_on","always_on"]
    },
    "movementPersistence": {
      "type": "integer",
      "default": 0,
      "description": "Movement persistence duration (minutes, 0 = disabled)",
      "minimum": 0,
      "maximum": 250,
      "multipleOf": 15
    },

    "wifiConfiguration": {
      "type": "boolean",
      "default": true,
      "description": "Enable WiFi access-point for configuration on reboot and button press"
    }
  },

  "modules" : {
    "calibration" : {
      "displayName": "Calibration",
      "type": "object",
      "properties": {
        "interval": {
          "displayName": "Calibration Interval",
          "access": 1,
          "type": "integer",
          "description": "Calibration beacons interval expressed in multiples of 20ms. Calibration beacons are high power beacons that are required for the Pixels to acquire their clock. Calibration beacons require high output power.",
          "minimum": 10,
          "maximum": 255,
          "default": 10
        },
        "outputPower": {
          "displayName": "Calibration Output Power",
          "access": 3,
          "type": "string",
          "description": "Output power for Pixels calibration, specified relative to the device's maximum TX power. The selected value will be rounded down to the nearest lower supported TX-power step for this board, so some entries may yield the same actual output.",
          "enum": ["Maximum", "Maximum - 2 dBm", "Maximum - 6 dBm", "Maximum - 10 dBm", "Maximum - 14 dBm", "Maximum - 18 dBm", "Maximum - 22 dBm"],
          "default": "Maximum"
        },
        "pattern": {
          "displayName": "Calibration Pattern",
          "access": 1,
          "type": "string",
          "description": "Calibration pattern defines sequence and channels of the calibration beacons.",
          "enum": ["Standard beaconing", "No Beacons on Channel 37", "EU pattern", "Disable calibration beaconing"],
          "default": "No Beacons on Channel 37"
        }
      }
    },
    "datapath" : {
      "displayName": "Datapath",
      "type": "object",
      "properties": {
        "rssiThreshold": {
          "displayName": "Pixels RSSI Threshold",
          "access": 2,
          "type": "integer",
          "description": "The bridge will filter pixels that have weaker RSSI than the threshold, setting to 0 will disable the feature",
          "minimum": -127,
          "maximum": 0,
          "default": 0
        },
        "pacerInterval": {
          "displayName": "Cloud Update Rate (Pacing Interval)",
          "access": 3,
          "type": "integer",
          "description": "Cloud update rate of a single Wiliot IoT Pixels in seconds",
          "minimum": 1,
          "maximum": 65000,
          "default": 15
        },
        "pktFilter": {
          "displayName": "Packet Filter",
          "access": 3,
          "type": "string",
          "description": "Filter that controls which packet types are forwarded to the cloud every pacing interval",
          "enum": ["Random first Arriving packet", "Disable forwarding", "Temperature packet", "Temperature and Advanced packets", "Temperature Advanced and Debug packets"],
          "default": "Temperature and Advanced packets"
        },
        "txRepetition": {
          "displayName": "Number of Retransmissions",
          "access": 1,
          "type": "integer",
          "description": "Number of times a bridge sends data, side info, or a heartbeat packet. Configuration 0 means automated bridge control",
          "minimum": 0,
          "maximum": 7,
          "default": 0
        },
        "outputPower": {
          "displayName": "Datapath Output Power",
          "access": 3,
          "type": "string",
          "description": "Output power for datapath (Pixels data forwarding and bridge management traffic) relative to the device's maximum TX power. The selected value will be rounded down to the nearest lower supported TX-power step for this board, so some entries may yield the same actual output.",
          "enum": ["Maximum", "Maximum - 2 dBm", "Maximum - 6 dBm", "Maximum - 10 dBm", "Maximum - 14 dBm", "Maximum - 18 dBm", "Maximum - 22 dBm"],
          "default": "Maximum"
        },
        "pattern": {
          "displayName": "Datapath Pattern",
          "access": 1,
          "type": "string",
          "description": "datapath pattern defines sequence and channels of the datapath (echoing and bridge management) beacons.",
          "enum": ["Standard beaconing", "No Beacons on Channel 37", "EU pattern", "Extended Advertising", "Extended Advertising - No Pointers on Channel 37", "Extended Advertising - Channel 10"],
          "default": "Standard beaconing"
        },
        "rxChannel": {
          "displayName": "Scanning Channel",
          "access": 1,
          "type": "string",
          "description": "Scanning channel where the Bridge listens for packets. Selecting a secondary advertisement channel allows partial functionality of BLE 5 protocol",
          "enum": ["Channel 37 - primary advertisement channel", "Channel 38 - primary advertisement channel", "Channel 39 - primary advertisement channel", "Channel 10 - 2Mbps - E2/E3 Pixels", "Channel 10 - 2Mbps - E4 Pixels", "Channel Hopping - 37 and 10", "Channel 21 - 2Mbps - E4 Pixels"],
          "default": "Channel 37 - primary advertisement channel"
        },
        "dynPacingWindow": {
          "displayName": "Dynamic Pacing Time Window",
          "access": 1,
          "type": "integer",
          "description": "Duration for changing to Dynamic Pacing - temporarily lowering pacing (packet filtering) of a Wiliot IoT Pixel that had a location event. The unit of time is determined by the 'Dynamic Pacing Time Unit' setting (sec, min or hours). A value of 0 enables pacing for all events.",
          "minimum": 0,
          "maximum": 255,
          "default": 0
        },
        "dynPacingTimeUnit": {
          "displayName": "Dynamic Pacing Time Unit",
          "access": 1,
          "type": "string",
          "description": "Unit of time (sec, min or hours) used for the 'Dynamic Pacing Time Window', 0 for sec, 1 for min and 2 for hours",
          "enum": ["Seconds", "Minutes", "Hours"],
          "default": "Seconds"
        },
        "dynPacingTrigger": {
          "displayName": "Dynamic Pacing Trigger",
          "access": 1,
          "type": "string",
          "description": "Types of Pixel events that will trigger the Bridge to move to dynamic pacing - New Pixel, Temperature Change (from Pixel), Tx Rate Change (from Pixel), RSSI Change.",
          "enum": ["No Trigger", "New Pixel", "Temperature Change", "New Pixel or Temperature Change", "Tx Rate Change", "New Pixel or Tx Rate Change", "Temperature Change or Tx Rate Change", "New Pixel, Temperature Change or Tx Rate Change", "RSSI Change", "New Pixel or RSSI Change", "Temperature Change or RSSI Change", "New Pixel, Temperature Change or RSSI Change", "Tx Rate or RSSI Change", "New Pixel, Tx Rate or RSSI Change", "Temperature Change, Tx Rate Change or RSSI Change", "All Triggers"],
          "default": "No Trigger"
        },
        "rssiMovementThreshold": {
          "displayName": "RSSI Movement Threshold",
          "access": 1,
          "type": "integer",
          "description": "Deviation from mean RSSI on Bridge indicating a Pixel has moved.",
          "minimum": 0,
          "maximum": 60,
          "default": 6
        },
        "dynPacingInterval": {
          "displayName": "Dynamic Pacing Interval",
          "access": 3,
          "type": "integer",
          "description": "Cloud update rate of a single Wiliot IoT Pixels in seconds during Dynamic Pacing Time Window.",
          "minimum": 0,
          "maximum": 65000,
          "default": 0
        }
      }
    },
    "energy2400" : {
      "displayName": "Energizer 2.4GHz",
      "type": "object",
      "properties": {
        "dutyCycle": {
          "displayName": "Energizing duty cycle [%]",
          "access": 1,
          "type": "integer",
          "description": "Percentage of the energizing cycle during which energy is emitted on the 2.4GHz band",
          "minimum": 0,
          "maximum": 75,
          "default": 30
        },
        "pattern": {
          "displayName": "Energy Pattern",
          "access": 1,
          "type": "string",
          "description": "Defines the energizing channels and their sequence on the 2.4GHz band",
          "enum": ["No Energizing", "Channel 37", "Channel 38", "Channel 39", "2450MHz", "2454MHz"],
          "default": "No Energizing"
        },
        "outputPower": {
          "displayName": "2.4GHz Energizing Output Power",
          "access": 1,
          "type": "string",
          "description": "Output power of the 2.4 [GHz] band energizing signal relative to the device's maximum TX power. The selected value will be rounded down to the nearest lower supported TX-power step for this board, so some entries may yield the same actual output.",
          "enum": ["Maximum", "Maximum - 2 dBm", "Maximum - 6 dBm", "Maximum - 10 dBm", "Maximum - 14 dBm", "Maximum - 18 dBm", "Maximum - 22 dBm"],
          "default": "Maximum"
        },
        "signalIndicatorCycle": {
          "displayName": "Signal Indicator Cycle",
          "access": 1,
          "type": "integer",
          "description": "Duration in seconds between transmission of signal indicator packets, 0 means disable signal indicator packet",
          "minimum": 0,
          "maximum": 16383,
          "default": 0
        },
        "signalIndicatorRep": {
          "displayName": "Signal Indicator Retransmissions",
          "access": 1,
          "type": "integer",
          "description": "Number of times a bridge sends signal indicator packets in each cycle, when the 'Signal Indicator Cycle' is 0 this configuration is irrelevant",
          "enum": [1, 2, 3, 4],
          "default": 2
        }
      }
    },
    "energySub1g" : {
      "displayName": "Energizer Sub-1GHz",
      "type": "object",
      "properties": {
        "sub1gEnergyPattern": {
          "displayName": "Sub-1GHz Energy Pattern",
          "access": 1,
          "type": "string",
          "description": "Energizing pattern defines the energizing channels and their sequence on the Sub-1GHz band",
          "enum": ["No Energizing","Single Tone 915MHz","FCC (Hopping)","Single tone 916300MHz","Single tone 917500MHz","Australia","Israel","NZ (Hopping)","EU Lower Band"],
          "default": "No Energizing"
        },
        "dutyCycle": {
          "displayName": "Sub-1GHz Duty Cycle",
          "access": 1,
          "type": "integer",
          "description": "Percentage of the energizing cycle during which energy is emitted on the Sub-1GHz band",
          "minimum": 0,
          "maximum": 100,
          "default": 30
        },
        "signalIndicatorCycle": {
          "displayName": "Sub1g Signal Indicator Cycle",
          "access": 1,
          "type": "integer",
          "description": "Duration in seconds between transmission of sub1g signal indicator packets, 0 means disable signal indicator packet",
          "minimum": 0,
          "maximum": 16383,
          "default": 0
        },
        "signalIndicatorRep": {
          "displayName": "Sub1g Signal Indicator Retransmissions",
          "access": 1,
          "type": "integer",
          "description": "Number of times a bridge sends sub1g signal indicator packets in each cycle, when the 'Sub1g Signal Indicator Cycle' is 0 this configuration is irrelevant",
          "enum": [1, 2, 3, 4],
          "default": 2
        }
      }
    },
    "powerManagement" : {
      "displayName": "Power Management",
      "type": "object",
      "properties": {
        "staticLedsOn": {
          "displayName": "LEDs On (Static Mode)",
          "access": 3,
          "type": "integer",
          "description": "Turn on LEDs despite power management state",
          "enum": [0, 1],
          "default": 1
        },
        "staticKeepAlivePeriod": {
          "displayName": "Keep Alive Period (Static Mode)",
          "access": 1,
          "type": "integer",
          "description": "Interval of sending heartbeat and opening scanning window during sleep state [seconds]",
          "minimum": 0,
          "maximum": 155,
          "multipleOf": 5,
          "default": 20
        },
        "staticKeepAliveScan": {
          "displayName": "Keep Alive Scan (Static Mode)",
          "access": 1,
          "type": "integer",
          "description": "Determines the scanning window duration every keep-alive period [milliseconds]",
          "minimum": 0,
          "maximum": 630,
          "multipleOf": 10,
          "default": 300
        },
        "staticOnDuration": {
          "displayName": "On Duration (Static Mode)",
          "access": 3,
          "type": "integer",
          "description": "On duration, 0 means always sleep [seconds]",
          "minimum": 0,
          "maximum": 3810,
          "multipleOf": 30,
          "default": 0
        },
        "staticSleepDuration": {
          "displayName": "Sleep Duration (Static Mode)",
          "access": 3,
          "type": "integer",
          "description": "Sleep duration, 0 means always on [seconds]",
          "minimum": 0,
          "maximum": 122820,
          "multipleOf": 60,
          "default": 0
        },
        "dynamicLedsOn": {
          "displayName": "LEDs On (Dynamic Mode)",
          "access": 3,
          "type": "integer",
          "description": "Turn on LEDs despite power management state",
          "enum": [0, 1],
          "default": 1
        },
        "dynamicKeepAlivePeriod": {
          "displayName": "Keep Alive Period (Dynamic Mode)",
          "access": 1,
          "type": "integer",
          "description": "Interval of sending heartbeat and opening scanning window during sleep state [seconds]",
          "minimum": 0,
          "maximum": 155,
          "multipleOf": 5,
          "default": 20
        },
        "dynamicKeepAliveScan": {
          "displayName": "Keep Alive Scan (Dynamic Mode)",
          "access": 1,
          "type": "integer",
          "description": "Determines the scanning window duration every keep-alive period [milliseconds]",
          "minimum": 0,
          "maximum": 630,
          "multipleOf": 10,
          "default": 300
        },
        "dynamicOnDuration": {
          "displayName": "On Duration (Dynamic Mode)",
          "access": 3,
          "type": "integer",
          "description": "On duration, 0 means always sleep [seconds]",
          "minimum": 0,
          "maximum": 3810,
          "multipleOf": 30,
          "default": 0
        },
        "dynamicSleepDuration": {
          "displayName": "Sleep Duration (Dynamic Mode)",
          "access": 3,
          "type": "integer",
          "description": "Sleep duration, 0 means always on [seconds]",
          "minimum": 0,
          "maximum": 122820,
          "multipleOf": 60,
          "default": 0
        }
      }
    },
    "externalSensor" : {
      "displayName": "BLE Sensor",
      "type": "object",
      "properties": {
        "sensor0": {
          "displayName": "Sensor0",
          "access": 1,
          "type": "string",
          "description": "Enable bridge to forward data from this sensor",
          "enum": ["No_Sensor", "MinewS1", "USB dongle ADC", "Signal Indicator", "Zebra Printer", "ERM Smart MS"],
          "default": "No_Sensor"
        },
        "sensor1": {
          "displayName": "Sensor1",
          "access": 1,
          "type": "string",
          "description": "Enable bridge to forward data from this sensor",
          "enum": ["No_Sensor", "MinewS1", "USB dongle ADC", "Signal Indicator", "Zebra Printer", "ERM Smart MS"],
          "default": "No_Sensor"
        },
        "sensor2": {
          "displayName": "Sensor2",
          "access": 1,
          "type": "string",
          "description": "Enable bridge to forward data from this sensor",
          "enum": ["No_Sensor", "MinewS1", "USB dongle ADC", "Signal Indicator", "Zebra Printer", "ERM Smart MS"],
          "default": "No_Sensor"
        },
        "rssiThreshold": {
          "displayName": "Sensors RSSI Threshold",
          "access": 2,
          "type": "integer",
          "description": "The bridge will filter sensors and signal indicator packets that have weaker RSSI than the threshold, setting to 0 will disable the feature",
          "minimum": -127,
          "maximum": 0,
          "default": 0
        },
        "sub1gRssiThreshold": {
          "displayName": "Sub1g RSSI Threshold",
          "access": 2,
          "type": "integer",
          "description": "The bridge will filter signal indicator packets that have weaker RSSI than the threshold, setting to 0 will disable the feature",
          "minimum": -127,
          "maximum": 0,
          "default": 0
        }
      }
    }
  }
}
