# Range

## Function

This API is used to get the parameter range of AI > Setup > WanderDetection.

## Request Message

### Parameter Description

###### Table 1

Parameter | Range | Type | Description
--- | --- | --- | ---
channel | “CH1” ”CH1x”“IP_CH1” ” IP_CH1x”“WIFI_CH1”…” WIFI_CH1x” The number of channels depends on the functionality of the device. | string array | Each array bit represents a channel with a string. DVR/NVR requirements; IPC only uses CH1
page_type | “ChannelConfig”,“AlarmConfig” “AllConfig” | string | Data used to distinguish between channel configuration page and alarm configuration page “AllConfig”Used in nvr to obtain and set ipc parameters, with more light than ChannelConfig_ Linkage field

Sample:

    POST /API/AI/Setup/WanderDetection/Range HTTP/1.1

    {
        "version": "1.0",
        "data": {"page_type": "ChannelConfig"}
    }

## Response Message

### Parameter Description

###### Table 2

Parameter | Range | Type | Descripton
--- | --- | --- | ---
channel_info |  | Json Object | Channel information refer to Table x

###### Table x

Parameter | Range | Type | Description
--- | --- | --- | ---
CH1 |  | Json Object | Json see Table 3 for more information
... |  | Json Object |
IP_CH1 |  | Json Object |
... |  | Json Object |
WIFI_CH1 |  | Json Object |
... |  | Json Object |

###### Table 3

Parameter | Range | Type | Description
--- | --- | --- | ---
switch | true false | bool | switch，false: close true: open
sensitivity | 1-100 | int | Test sensitivity
snap_mode | "RealTimeMode" "OptimalMode" "IntervalMode" | string | Screenshot mode, intervalMode JSON show as follow Table Table 4
min_pixel | 64-1080 | int | Minimum pixel value
max_pixel | 320-1080 | int | Maximum pixel value
detection_mode | "StaticMode" "MotionMode" | string | Detection mode
time_threshold | 0-900 | int | time threshold
rule_info |  | JSON object | Single-channel information JSON is as follows Table 5
latch_time | "5","10","20","30" | string | Alarm output time
post_recording | "0","5","10","20","30" | string | Recording delay time
alarm_out | “Local->1” ”Local->x”“IP_CH1->1” “IP_CH1->2” ”IP_CHx->1” ”IP_CHx->2” The number of channels depends on the functionality of the device. | array | Alarm channel Each array bit is represented by a string representing the alarm output channel. Camera: Local ->1: On, null: Off
io_output |  | bool | Interlinked switch for IO output.
send_email | true false | bool | Send email switch
record_enable | true false | bool | Record channel switch
record_channel | “CH1” ”CH1x”“IP_CH1” ” IP_CH1x”“WIFI_CH1” | array | Alarm output channel Channel alarm linkage switch
ftp_picture_upload_channel | “CH1”…”CH1x” “IP_CH1”…” IP_CH1x” “WIFI_CH1”…” WIFI_CH1x” | array | Capture image FTP upload alarm output channel
ftp_picture_upload | true false | bool | Channel image FTP upload switch
ftp_video_upload | true false | bool | Channel video FTP upload switch
picture_to_cloud | true false | bool | Image upload switch (dedicated to NVR)
video_to_cloud | true false | bool | Video cloud upload switch (dedicated to NVR/DVR)
ftp_video_upload_channel | “CH1”…”CH1x” “IP_CH1”…” IP_CH1x” “WIFI_CH1”…” WIFI_CH1x” | array | Video FTP upload alarm output channel
siren |  | bool | alarm linkage switch.
deterrence |  | bool | Alarm light linkage switch.
mutual_exclusion | "PID" "LCD" "SOD" "PD" "FD" "CC" "SMD" "HEATMAP" "CD" "QD" "LPD" "OD" "INTRUSION" "REGIONENTRANCE" "REGIONEXITING" | json array | The collection of mutex functions that have been enabled at present. Note: If there is a mutex function that is already enabled, it will be brought when Get. If it is not enabled or there is no mutual exclusion, it is not necessary to pass this field

###### Table 4

Parameter | Range | Type | Description
--- | --- | --- | ---
snap_num | "1" "2" "3" "Unliimited" | string | Number of screenshots
snap_frequency |  | int | Screenshot interval, Unit:s/pic

###### Table 5

Parameter | Range | Type | Description
--- | --- | --- | ---
rule_number1 |  | Object | Rule number 1, the information JSON is displayed as follows Table 6
rule_number2 |  | Object | Rule number 2, the information JSON is displayed as follows Table 6
rule_number3 |  | Object | Rule number 3, the information JSON is displayed as follows Table 6
rule_number4 |  | Object | Rule number 4, the information JSON is displayed as follows Table 6

###### Table 6

Parameter | Range | Type | Description
--- | --- | --- | ---
detection_range | "FullScreen" "UserDefined" | string | Examination range
rule_switch | true, false | bool | /* One byte per channel represents up to 4 rules, 0- off, 1- Use */ (IPC Smart Generation only)
rule_rect |  | Object | octagon,Information JSON show as followTable 7
point_num | [min:max] | array | The number of points drawn in the area, minimum 3 points (min), maximum 8 points (max)

###### Table 7

Parameter | Range | Type | Description
--- | --- | --- | ---
x1 | 0-704 | short | x1 coordinate point
y1 | 0-576 | short | y1 coordinate point
x2 | 0-704 | short | x2 coordinate point
y2 | 0-576 | short | y2 coordinate point
x3 | 0-704 | short | x3 coordinate point
y3 | 0-576 | short | y3 coordinate point
x4 | 0-704 | short | x4 coordinate point
y4 | 0-576 | short | y4 coordinate point
x5 | 0-704 | short | x5 coordinate point
y5 | 0-576 | short | y5 coordinate point
x6 | 0-704 | short | x6 coordinate point
y6 | 0-576 | short | y6 coordinate point
x7 | 0-704 | short | x7 coordinate point
y7 | 0-576 | short | y7 coordinate point
x8 | 0-704 | short | x8 coordinate point
y8 | 0-576 | short | y8 coordinate point

Sample:

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "result": "success",
      "data": {
        "channel_info": {
          "type": "object",
          "items": {
            "CH1": {
              "type": "object",
              "items": {
                "switch": {
                  "type": "bool"
                },
                "sensitivity": {
                  "type": "int32",
                  "min": 1,
                  "max": 100
                },
                "snap_mode": {
                  "type": "string",
                  "items": [
                    "Default",
                    "RealTimeMode",
                    "IntervalMode"
                  ]
                },
                "snap_num": {
                  "type": "string",
                  "items": [
                    "1",
                    "2",
                    "3",
                    "Unlimited"
                  ]
                },
                "snap_frequency": {
                  "type": "int32",
                  "mode": "r",
                  "min": 1,
                  "max": 255,
                  "default_value": 2
                },
                "max_pixel": {
                  "type": "int32",
                  "mode": "r",
                  "min": 320,
                  "max": 1080,
                  "default_value": 320
                },
                "min_pixel": {
                  "type": "int32",
                  "mode": "r",
                  "min": 64,
                  "max": 1080,
                  "default_value": 64
                },
                "detection_mode": {
                  "type": "string",
                  "items": [
                    "HybridMode",
                    "MotionMode"
                  ]
                },
                "rule_info": {
                  "type": "object",
                  "items": {
                    "rule_number1": {
                      "type": "object",
                      "items": {
                        "detection_range": {
                          "type": "string",
                          "items": [
                            "FullScreen",
                            "UserDefined"
                          ]
                        },
                        "rule_switch": {
                          "type": "bool"
                        },
                        "point_num": {
                          "type": "array",
                          "size": 2,
                          "items": []
                        },
                        "rule_rect": {
                          "type": "object",
                          "items": {
                            "x1": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x2": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x3": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x4": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x5": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x6": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x7": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x8": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "y1": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y2": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y3": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y4": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y5": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y6": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y7": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y8": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            }
                          }
                        }
                      }
                    },
                    "rule_number2": {
                      "type": "object",
                      "items": {
                        "detection_range": {
                          "type": "string",
                          "items": [
                            "FullScreen",
                            "UserDefined"
                          ]
                        },
                        "rule_switch": {
                          "type": "bool"
                        },
                        "point_num": {
                          "type": "array",
                          "size": 2,
                          "items": []
                        },
                        "rule_rect": {
                          "type": "object",
                          "items": {
                            "x1": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x2": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x3": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x4": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x5": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x6": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x7": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x8": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "y1": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y2": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y3": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y4": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y5": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y6": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y7": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y8": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            }
                          }
                        }
                      }
                    },
                    "rule_number3": {
                      "type": "object",
                      "items": {
                        "detection_range": {
                          "type": "string",
                          "items": [
                            "FullScreen",
                            "UserDefined"
                          ]
                        },
                        "rule_switch": {
                          "type": "bool"
                        },
                        "point_num": {
                          "type": "array",
                          "size": 2,
                          "items": []
                        },
                        "rule_rect": {
                          "type": "object",
                          "items": {
                            "x1": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x2": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x3": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x4": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x5": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x6": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x7": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x8": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "y1": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y2": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y3": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y4": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y5": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y6": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y7": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y8": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            }
                          }
                        }
                      }
                    },
                    "rule_number4": {
                      "type": "object",
                      "items": {
                        "detection_range": {
                          "type": "string",
                          "items": [
                            "FullScreen",
                            "UserDefined"
                          ]
                        },
                        "rule_switch": {
                          "type": "bool"
                        },
                        "point_num": {
                          "type": "array",
                          "size": 2,
                          "items": []
                        },
                        "rule_rect": {
                          "type": "object",
                          "items": {
                            "x1": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x2": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x3": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x4": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x5": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x6": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x7": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "x8": {
                              "type": "int32",
                              "min": 0,
                              "max": 704
                            },
                            "y1": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y2": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y3": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y4": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y5": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y6": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y7": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            },
                            "y8": {
                              "type": "int32",
                              "min": 0,
                              "max": 576
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "time_threshold": {
                  "type": "int32",
                  "min": 0,
                  "max": 900
                },
                "draw_add_btn": {
                  "type": "object",
                  "items": {
                    "visible": {
                      "type": "bool"
                    }
                  }
                },
                "btn_get_default_data": true
              }
            }
          }
        }
      }
    }

## Error Code

See Response Messages Body and Common error_code for more information.