start-format-sd

Added in: V1.3

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

In order to format SD card, the following conditions must be met.

  • firmware update is not in progress
  • reset or reboot 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 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

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

Device status Condition
SD 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 percentage of USB format.
client-id Reserved

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

results matching ""

    No results matching ""

    results matching ""

      No results matching ""