# Configuration related

## 1.Get a list of connected hardware

### Calling  <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter | type   | illustrate      | Remark                |
| --------- | ------ | --------------- | --------------------- |
| fun       | String | /config/usb/get | Request function name |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/config/usb/get'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/config/usb/get
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/config/usb/get",
    "data": {
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
 {
  "data": {
    "list": [
      {
        "vid": "720D",
        "pid": "1F2D",
        "uid": "1F2D24BD",
        "ver": "4.4",
        "state": 2
      },
      {
        "vid": "720D",
        "pid": "FF2D",
        "uid": "FF2D24BD",
        "ver": "4.4",
        "state": 2
      }
    ],
    "code": 0,
    "id": "",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/config/usb/get"
}
```

* **Response data field description**

| Fields | illustrate       | Remark |
| ------ | ---------------- | ------ |
| vid    |                  | -      |
| pid    |                  | -      |
| uid    | Hardware ID      | -      |
| ver    | Hardware version | -      |

## 2.Get a list of supported device type libraries

### Calling  <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter | type   | illustrate              | Remark                |
| --------- | ------ | ----------------------- | --------------------- |
| fun       | String | /config/devicemodel/get | Request function name |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/config/devicemodel/get'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/config/devicemodel/get
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/config/devicemodel/get",
    "data": {
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
 {
  "data": {
    "list": [
      太多了省略
    ],
    "code": 0,
    "id": "",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/config/devicemodel/get"
}
```

* **Response data data field description**\
  list array records the obtained data.

## 3.Get kernel configuration

### Calling  <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter | type   | illustrate           | Remark                |
| --------- | ------ | -------------------- | --------------------- |
| fun       | String | /config/imserver/get | Request function name |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/config/imserver/get'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/config/imserver/get
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/config/imserver/get",
    "data": {
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
 {
  "data": {
    "air_play_name": "iMouseXP-D2B6",
    "lang": "简体中文",
    "mdns_type": 0,
    "connect_failed_retry": 3,
    "air_play_ratio": 0,
    "opencv_num": 1,
    "ocr_num": 1,
    "allow_ip_list": [],
    "air_play_fps": 30,
    "air_play_img_fps": 0,
    "air_play_refresh_rate": 60,
    "air_play_port": 17000,
    "air_play_audio": true,
    "auto_connect": false,
    "auto_updata": false,
    "thread_mode": false,
    "mouse_mode": true,
    "flip_right": true,
    "code": 0,
    "id": "",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/config/imserver/get"
}
```

* **Response data field description**

| Fields                   | illustrate                                       | Remark                                                    |
| ------------------------ | ------------------------------------------------ | --------------------------------------------------------- |
| air\_play\_name          | Display name on screen                           | -                                                         |
| mdns\_type               | Screencast Discovery Rules                       | 0 allows all, 1 specifies the IP, 2 is the IP in the list |
| connect\_failed\_retry   | Connection failed retry times                    | 0 Infinite retries                                        |
| air\_play\_ratio         | Screen projection resolution                     | 0Adaptive,720,1080,1400,1920,2650                         |
| opencv\_num              | Number of image search plugin instances          | -                                                         |
| ocr\_num                 | Number of OCR text recognition plug-in instances | Only the GPU version is effective                         |
| allow\_ip\_list          | Allowed ip list                                  | It only takes effect when the rule is 1.                  |
| air\_play\_fps           | Screen projection fps                            | Maximum 30, minimum 1                                     |
| air\_play\_img\_fps      | Projected image fps                              | Maximum 30, minimum 1                                     |
| air\_play\_refresh\_rate | Screen refresh rate                              | Maximum 60, minimum 1                                     |
| air\_play\_port          | Screen projection communication port             | Default 17000                                             |
| air\_play\_audio         | Screen projection sound                          | true to enable, false to disable                          |
| auto\_connect            | Automatically connect to screen projection       | -                                                         |
| auto\_updata             | Automatic Upgrade                                | -                                                         |
| thread\_mode             | Use thread mode to batch operate hardware        | -                                                         |
| mouse\_mode              | Use fast and accurate mouse movement             | -                                                         |
| flip\_right              | Horizontal screen flip right mode                | -                                                         |

## 4.Setting the kernel configuration

### Calling  <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter                | type         | illustrate                                       | Remark                                                    |
| ------------------------ | ------------ | ------------------------------------------------ | --------------------------------------------------------- |
| fun                      | String       | /config/imserver/set                             | Request function name                                     |
| air\_play\_name          | String       | Display name on screen                           | -                                                         |
| lang                     | String       | Console Language                                 | -                                                         |
| mdns\_type               | Integer      | Screencast Discovery Rules                       | 0 allows all, 1 specifies the IP, 2 is the IP in the list |
| connect\_failed\_retry   | Integer      | Connection failed retry times                    | 0 Infinite retries                                        |
| air\_play\_ratio         | Integer      | Screen projection resolution                     | 0Adaptive,720,1080,1400,1920,2650                         |
| opencv\_num              | Integer      | Number of image search plugin instances          | -                                                         |
| ocr\_num                 | Integer      | Number of OCR text recognition plug-in instances | Only the GPU version is effective                         |
| allow\_ip\_list          | String Array | Allowed ip list                                  | It only takes effect when the rule is 1.                  |
| air\_play\_fps           | Integer      | Screen projection fps                            | Maximum 30, minimum 1                                     |
| air\_play\_img\_fps      | Integer      | Projected image fps                              | Maximum 30, minimum 1                                     |
| air\_play\_refresh\_rate | Integer      | Screen refresh rate                              | Maximum 60, minimum 1                                     |
| air\_play\_port          | Integer      | Screen projection communication port             | Default 17000                                             |
| air\_play\_audio         | Boolean      | Screen projection sound                          | true to enable, false to disable                          |
| auto\_connect            | Boolean      | Automatically connect to screen projection       | -                                                         |
| auto\_updata             | Boolean      | Automatic Upgrade                                | -                                                         |
| thread\_mode             | Boolean      | Use thread mode to batch operate hardware        | -                                                         |
| mouse\_mode              | Boolean      | Use fast and accurate mouse movement             | -                                                         |
| flip\_right              | Boolean      | Horizontal screen flip right mode                | -                                                         |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/config/imserver/set?air_play_name=iMouseXP-D2B6&lang=%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87&mdns_type=0&connect_failed_retry=2&air_play_ratio=1080&opencv_num=1&ocr_num=1&allow_ip_list=[]&air_play_fps=30&air_play_img_fps=30&air_play_refresh_rate=60&air_play_port=17000&air_play_audio=true&auto_connect=true&auto_updata=true&thread_mode=true&flip_right=true&auto_updata=true&mouse_mode=true'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/config/imserver/set \
  --form air_play_name=iMouseXP-D2B6 \
  --form lang=%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87 \
  --form mdns_type=0 \
  --form connect_failed_retry=1 \
  --form air_play_ratio=0 \
  --form opencv_num=1 \
  --form ocr_num=1 \
  --form air_play_fps=30 \
  --form air_play_img_fps=30 \
  --form air_play_refresh_rate=60 \
  --form air_play_port=17000 \
  --form air_play_audio=true \
  --form auto_connect=true \
  --form auto_updata=true \
  --form mouse_mode=true \
  --form thread_mode=true \
  --form flip_right=true 
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/config/imserver/set",
    "data": {
        "air_play_name": "iMouseXP-D2B6",
        "lang": "简体中文",
        "mdns_type": 0,
        "connect_failed_retry": 3,
        "air_play_ratio": 0,
        "opencv_num": 1,
        "ocr_num": 1,
        "allow_ip_list": [],
        "air_play_fps": 30,
        "air_play_img_fps": 0,
        "air_play_refresh_rate": 60,
        "air_play_port": 17000,
        "air_play_audio": true,
        "auto_connect": false,
        "auto_updata": false,
        "thread_mode": false,
        "mouse_mode": true,
        "flip_right": true
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
 {
  "data": {
    "air_play_name": "iMouseXP-D2B6",
    "lang": "简体中文",
    "mdns_type": 0,
    "connect_failed_retry": 3,
    "air_play_ratio": 0,
    "opencv_num": 1,
    "ocr_num": 1,
    "allow_ip_list": [],
    "air_play_fps": 30,
    "air_play_img_fps": 0,
    "air_play_refresh_rate": 60,
    "air_play_port": 17000,
    "air_play_audio": true,
    "auto_connect": false,
    "auto_updata": false,
    "thread_mode": false,
    "mouse_mode": true,
    "flip_right": true,
    "code": 0,
    "id": "",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/config/imserver/get"
}
```

* **Response data field description**

| Fields                   | illustrate                                       | Remark                                                    |
| ------------------------ | ------------------------------------------------ | --------------------------------------------------------- |
| air\_play\_name          | Display name on screen                           | -                                                         |
| lang                     | Console Language                                 | -                                                         |
| mdns\_type               | Screencast Discovery Rules                       | 0 allows all, 1 specifies the IP, 2 is the IP in the list |
| connect\_failed\_retry   | Connection failed retry times                    | 0 Infinite retries                                        |
| air\_play\_ratio         | Screen projection resolution                     | 0Adaptive,720,1080,1400,1920,2650                         |
| opencv\_num              | Number of image search plugin instances          | -                                                         |
| ocr\_num                 | Number of OCR text recognition plug-in instances | Only the GPU version is effective                         |
| allow\_ip\_list          | Allowed ip list                                  | It only takes effect when the rule is 1.                  |
| air\_play\_fps           | Screen projection fps                            | Maximum 30, minimum 1                                     |
| air\_play\_img\_fps      | Projected image fps                              | Maximum 30, minimum 1                                     |
| air\_play\_refresh\_rate | Screen refresh rate                              | Maximum 60, minimum 1                                     |
| air\_play\_port          | Screen projection communication port             | Default 17000                                             |
| air\_play\_audio         | Screen projection sound                          | true to enable, false to disable                          |
| auto\_connect            | Automatically connect to screen projection       | -                                                         |
| auto\_updata             | Automatic Upgrade                                | -                                                         |
| thread\_mode             | Use thread mode to batch operate hardware        | -                                                         |
| mouse\_mode              | Use fast and accurate mouse movement             | -                                                         |
| flip\_right              | Horizontal screen flip right mode                | -                                                         |

## 5.Re-broadcast screen

### Calling  <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter | type   | illustrate        | Remark                |
| --------- | ------ | ----------------- | --------------------- |
| fun       | String | /imserver/regmdns | Request function name |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/imserver/regmdns'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/imserver/regmdns
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/imserver/regmdns",
    "data": {
        
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
   {
  "data": {
    "code": 0,
    "id": "90:81:58:EE:D1:9E",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/imserver/regmdns"
}
```

* **Response data data field description**\
  None

## 6.Restart the kernel

### Calling <a href="#diao-yong-shuo-ming" id="diao-yong-shuo-ming"></a>

* **Request Parameters**

| parameter | type   | illustrate        | Remark                |
| --------- | ------ | ----------------- | --------------------- |
| fun       | String | /imserver/restart | Request function name |

* **httpGet request example**

```
curl --request GET \
  --url 'http://192.168.9.9:9911/api/imserver/restart'
```

* **httpPost request example**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'content-type: multipart/form-data' \
  --form fun=/imserver/restart
```

* **httpPost json request example \[websocket can also send the same json request]**

```
curl --request POST \
  --url http://192.168.9.9:9911/api \
  --header 'Content-Type: application/json' \
  --data '{
    "fun": "/imserver/restart",
    "data": {
        
    }
}'
```

### Response  <a href="#xiang-ying-jie-guo" id="xiang-ying-jie-guo"></a>

```
   {
  "data": {
    "code": 0,
    "id": "90:81:58:EE:D1:9E",
    "message": "成功"
  },
  "status": 200,
  "message": "成功",
  "msgid": 0,
  "fun": "/imserver/restart"
}
```

* **Response data data field description**\
  None
