SD Card Management

Last Updated on : 2024-06-17 08:11:32download

SD card management is implemented with data points (DPs). You can check the DP constants in IPC Control on Android. For more information about how to query and use DPs, see Device Control of Smart Life App SDK.

Query SD card status

Returns SD card status based on the DP ID 110. The DP code is sd_status.

Before SD card management or SD card-stored video playback, you must check the status of the SD card. If no SD card is found on the IP camera (IPC), you cannot perform subsequent steps. If the SD card has faults, you must format it first.

Value Description
1 The SD card is normal.
2 Exceptions occur in the SD card, such as damaged SD card or incorrect format.
3 The SD card has insufficient space.
4 The SD card is being formatted.
5 No SD card is found.
7 Waiting for wakeup. The main module has not woken up, or the SD card is still loading.

To send the DP data, pass in null without a parameter.

Format an SD card

Formats an SD card based on the DP ID 111. The DP code is sd_format.

SD card formatting can be implemented in the following ways based on different types of IPC firmware:

  • Most types of IPC firmware regularly report the progress of ongoing formatting. They also report the current storage capacity at the end of formatting.
  • A few types of IPC firmware do not report the progress of formatting. Therefore, you must regularly check the progress. When the progress reaches 100, you can check the storage capacity of the SD card.

Query formatting progress

Returns the progress of formatting an SD card based on the DP ID 117. The DP code is sd_format_state.

When the progress reaches 100, the formatting task is finished. Then, you can check the storage capacity.

Query storage capacity

Returns the storage capacity of an SD card based on the DP ID 109. The DP code is sd_storge.

The storage capacity is returned as a string in the format of total capacity|used capacity|idle capacity. Unit: KB.

Enable or disable video recording

Enables or disables SD card-stored video recording based on the DP ID 150. The DP code is record_switch.

Switch between video recording modes

Switches between SD card-stored video recording modes based on the DP ID 151. The DP code is record_mode.

After an SD card is inserted into an IPC, videos are recorded and saved to the SD card. The IPC SDK can be used to set the video recording switch and mode.

Value Description
1 Event-triggered mode. The IPC starts video recording only after a detection alert is generated. The video duration varies depending on the type and duration of the event.
2 Continuous recording mode. The IPC continuously collects audios and videos and saves them to the SD card. If the storage capacity is insufficient, the earliest content will be overwritten by the latest content.