start-format-usb
Deprecated at V2.2, use start-disk-format instead.
Use the interface to format the USB flash drive. The stored data cannot be recovered after formatting and the process can not be canceled.
In order to format the USB flash drive, the following conditions must be met.
- firmware update is not in progress
- neither reset nor reboot is in progress
- recording is not in progress
- USB performance test is not in progress
- USB flash drive is valid to work
Obtain mask of device status and USB status using get-status.
"cur-status": 65552 // device running status mask
"disk-info" [
{
"disk-status": 1, // USB status mask
"disk-type": 0, // 0: USB flash drive, 1: SD card
"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 |
record is not in progress | cur-status & statusRecord != statusRecord |
USB performance test is not in progress | cur-status & statusDiskTest != statusDiskTest |
The output of disk-status
& USB Status is as follows.
Device status | Condition |
---|---|
USB is valid to work | disk-status & DiskValid = DiskValid |
HTTP Request
GET http://ip/usapi?method=start-format-usb
Parameter | Description |
---|---|
method | start-format-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 that system is busy. Refer to API Status Codes to find specific description for other values. |
Format Status
Obtain format-status using the get-status.
"format-status": {
"result": 27,
"percent": 20,
"client-id": ""
}
Item | Description |
---|---|
result | Returned status. 27 indicates that USB is in initial state. 2 indicates that USB is formatting. 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. |
client-id | Reserved |
Call clear-format-usb to reset the device to the initial status (retInit=27) after the USB format is completed.