start-test-usb

Use the interface to test whether the write speed of USB flash drive meets the requirements before recording. You can call the stop-test-usb to cancel the request during testing.

In order to test the performance of USB flash drive, the following conditions must be met.

  • firmware update is not in progress
  • reset and reboot is not in progress
  • recording is not in progress
  • USB format is not in progress
  • USB performance test is not in progress
  • USB is valid to work
  • USB has more than 200M free space
  • USB is writable

Obtain the mask of device status and USB status using get-status.

"cur-status": 65552          // device running status mask
"usb": {
 "disk-status": 1,          // USB status mask
 "total-size": 61638148096,
 "used-size": 97058816,
 ...
}

The output of cur-status & Device Status Mask are as follows.

Device status Condition
Firmware update is not in progress cur-status & statusUpgrade != statusUpgrade
Reset all settings is not in progress cur-status & statusReset != statusReset
Reboot is not in progress cur-status & statusReboot != statusReboot
Recording is not in progress cur-status & statusRecord != statusRecord
USB format is not in progress cur-status & statusFormatDisk != statusFormatDisk
USB performance test is not in progress cur-status & statusDiskTest != statusDiskTest

The output of disk-status & USB Status are as follows.

Device status Condition
USB is valid to work disk-status & DiskValid = DiskValid
USB has more then 200 M free space disk-status & LowSpace != LowSpace
USB is writable disk-status & NotWrite != NotWrite

HTTP Request

GET http://ip/usapi?method=start-test-usb
Parameter Description
method start-test-usb

Response Body

{
 "result": 0
}
Item Description
result Returned status.
0 indicates that the USB starts to format.
1 indicates repeat request
-5 indicates USB disk is error.
-9 indicates system is busy.
-16 indicates there is not enough free space on USB flash drive.
Refer to API Status Codes to find specific description for other values.

The Lowest Required Write Speed

Obtain the recording configurations using get-settings.

"rec-stream": 0,
"main-stream": {
 "kbps": 4096,
 ...
},
"sub-stream": {
 "kbps": 1024,
 ...
}
"audio": {
 "kbps": 128
 ...
}

rec-stream indicates the recording stream type. 0 indicates main-stream, 1 indicates sub-stream.

The current recording requirSpeed can be calculated with the above information.

requirSpeed = main-stream.kbps + audio.kbps 
      = (4096 Kbps + 128 Kbps)
      = 4224 Kbps / 1024 * 8
      ≈ 0.52 MB/S

Performance Test Status

Obtain the disk-test information using get-status.

"disk-test": {
 "read-bps": 0,
 "write-bps": 14833071,  // 14833071 bps / 1024 * 1024 ≈ 14.15 MB/S
 "percent": 3,
 "result": 2,
 "client-id": "web-session-32435088"
}
Item Description
result Returned status.
27 indicates that the device is in initial status.
5 indicates the request is canceled.
2 indicates the USB performance test is in progress.
Returned status.
0 indicates that the request was accepted successfully. Refer to API Status Codes to find specific description for other values.
percent Indicates the percentage of USB format.
read-bps Indicates current read speed.
write-bps Indicates current write speed. The USB disk performance is up to standard if it is above the requirSpeed.
client-id Reserved

Call the clear-test-usb to reset the device to the initial status (retInit=27) after the performance test is completed.

results matching ""

    No results matching ""

    results matching ""

      No results matching ""