{
  "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]
    },
    "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"
        },
        "filterManagement": {
          "type": "boolean",
          "default": false
        },
        "bridgeIds": {
          "default": [],
          "type": "array",
          "minItems": 0,
          "maxItems": 64,
          "items": {
            "type": "string",
            "pattern": "^[0-9A-F]{12}$"
          }
        }
      }
    },

    "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]
    },

    "bluetoothRxChannels": {
      "type": "integer",
      "default": 4,
      "description": "Bluetooth scan channels bit mask (1 = Channel 37 only, 2 = Channel 38 only, 3 = Channels 37 + 38, 4 = Channel 39 only, 5 = Channels 37 + 39 , 6 = Channels 38 + 39, 7 = Channels 37 + 38 + 39)",
      "minimum": 1,
      "maximum": 7
    },
    "bluetoothAdvertise": {
      "type": "boolean",
      "default": false,
      "description": "Bluetooth advertising when receiver is on"
    },

    "bridgeResetInterval": {
      "type": "integer",
      "default": 0,
      "description": "Interval in hours between automatic bridge reset (0 = Disabled)",
      "minimum": 0,
      "maximum": 250
    },
    "bridgeResetAutomatic": {
      "type": "boolean",
      "default": false,
      "description": "Enable automatic bridge reset if bridges on the ACL are not detected for 4 minutes"
    },
    "bridgeOutWhileMoving": {
      "type": "boolean",
      "default": false,
      "description": "Enable bridge output while movement is detected"
    },
    "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"
    },

    "inputEvents": {
      "type": "boolean",
      "default": false,
      "description": "Enable gateway input events (ermInC / ermInD / ermInE / ermInF)"
    },

    "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
    },

    "temperatureInterval": {
      "type": "integer",
      "default": 0,
      "description": "Temperature report interval (minutes, 0 = disabled)",
      "enum": [0, 15, 30, 60, 90, 120, 180, 300, 600, 720]
    },

    "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
    }
  }
}
