start-format-sd

Added in V1.3

Use the interface to format SD card. The data cannot be recovered after formatting and the operation can not be canceled.

The prerequisites for formatting SD card are as follows.

  • firmware updating is not in progress
  • resetting or rebooting the device is not in progress
  • recording is not in progress
  • SD card is valid to work

Obtain the following information using get-status.

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

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

Device status Condition
Firmware updating is not in progress cur-status & statusUpgrade != statusUpgrade
Resetting device is not in progress cur-status & statusReset != statusReset
Rebooting device is not in progress cur-status & statusReboot != statusReboot
Recording is not in progress cur-status & statusRecord != statusRecord

The output of disk-status & Storage device status is as follows.

Device status Condition
SD card is valid to work disk-status & DiskValid = DiskValid

HTTP Request

GET http://ip/usapi?method=start-format-sd
Parameter Description
method start-format-sd

Response Body

{
  "result": 0
}
Item Description
result Returned status.
0 indicates that the SD card starts to format.
1 indicates repeat request.
-5 indicates SD card is error.
-9 indicates system is busy.
Refer to API Status Codes to find specific description for other values.

Format Process Status

Obtain the format-status information using get-status .

"format-status": {
  "result": 27,
  "percent": 20,
  "client-id": ""
}
Item Description
result Returned status.
27 indicates that the device is in initial status.
2 indicates the SD format is in progress.
0 indicates that the request was accepted successfully. Refer to API Status Codes to find specific description for other values.
percent Indicates the process of SD format.
client-id Reserved

Call the clear-format-sd to reset the device to the initial status (retInit=27) after the SD format is completed successfully or not.

results matching ""

    No results matching ""

    results matching ""

      No results matching ""