Offline Collect Data

When the access control device is not connected to the client software or platform via the network, you can collect data (including ID card information, card information, face data, and fingerprint) locally on the stand-alone device by importing description of the information that needs to be collected. The offline collected data will be stored on the device and can also be downloaded, exported, or deleted from the device.

  • Make sure you have called NET_DVR_Init to initialize the development environment.

  • Make sure you have called NET_DVR_Login_V40 to log in to the device.

Figure 1 Programming Flow of Offline Collecting Data

  1. Call NET_DVR_STDXMLConfig to pass through the request URL: GET /ISAPI/AccessControl/capabilities for getting the access control capability to check whether the device supports offline data collection.

    The capability is returned in the message XML_Cap_AccessControl by lpOutBuffer of lpOutputParam.

    If this function is supported, the node <isSupportOfflineCapture> will be returned and its value is "true". Otherwise, please end this task.

  2. Call NET_DVR_STDXMLConfig to pass through the request URL: GET /ISAPI/AccessControl/OfflineCapture/capabilities?format=json for getting the capability of collecting data offline to know the supported parameters.

    The capability is returned in the message JSON_OfflineCaptureCap lpOutBuffer of lpOutputParam.

  3. Optional: Download the user list template of offline data collection.
    1. Call NET_DVR_StartDownload and set the input parameter dwDownloadType to "NET_SDK_DOWNLOAD_OFFLINE_CAPTURE_INFO_TEMPLATE" (macro definition value: 40) to start downloading.
    2. Call NET_DVR_GetDownloadState to get the downloading progress.
    3. Call NET_DVR_StopDownload to stop downloading.
  4. Import the user list of offline data collection filled in the template.
    1. Call NET_DVR_UploadFile_V40, set dwUploadType to "UPLOAD_OFFLINE_CAPTURE_INFO" (macro definition value: 56), and set lpInBuffer to the structure NET_DVR_DOOR_FILE_UPLOAD_PARAM for start uploading the file.
    2. Call NET_DVR_GetUploadState to get the file uploading progress.
    3. Call NET_DVR_UploadClose to stop uploading.
    Note:

    If importing failed, you can call NET_DVR_STDXMLConfig to transmit the request URI: GET /ISAPI/AccessControl/OfflineCapture/uploadFailedDetails?format=json for getting the details of failing to upload the user list of offline data collection.

    The uploading failure details are returned in the message JSON_UploadFailedDetails by lpOutputParam.

  5. Call NET_DVR_STDXMLConfig to pass through the request URL: PUT /ISAPI/AccessControl/OfflineCapture/ruleInfo?format=json and set lpInBuffer of lpInputParam to the message JSON_RuleInfo for setting rule parameters of offline data collection.
    Note:

    Before setting rule parameters of offline data collection, you'd better call NET_DVR_STDXMLConfig to pass through the request URL: GET /ISAPI/AccessControl/OfflineCapture/ruleInfo?format=json for getting the existing or configured parameters for reference. The parameters are returned in the message JSON_RuleInfo by lpOutBuffer of lpOutputParam.

  6. Collect ID card information, card information, face data, or fingerprint on the stand-alone device offline.
  7. Optional: Call NET_DVR_STDXMLConfig to pass through the request URL: GET /ISAPI/AccessControl/OfflineCapture/progress?format=json for getting the progress of offline data collection.

    The collection progress is returned in the message JSON_CaptureProgress by lpOutBuffer of lpOutputParam.

  8. Optional: Perform the following operation(s) after collecting data offline.
    Option Description

    Export Collected Data

    Call NET_DVR_STDXMLConfig to pass through the request URL: PUT /ISAPI/AccessControl/OfflineCapture/dataOutput?format=json and set lpInBuffer of lpInputParam to the message JSON_DataOutputCfg.

    Note:

    During exporting, you can call NET_DVR_STDXMLConfig to pass through the request URL: GET /ISAPI/AccessControl/OfflineCapture/dataOutput/progress?format=json for getting the progress of exporting the offline collected data.

    Download Collected Data

    1. Call NET_DVR_StartDownload and set the dwDownloadType to "NET_SDK_DOWNLOAD_CAPTURE_DATA" (macro definition value: 41) to start downloading.

    2. Call NET_DVR_GetDownloadState to get the downloading status.

    3. Call NET_DVR_StopDownload to stop downloading.

    Search for Collected Data

    1. Call NET_DVR_StartRemoteConfig with "NET_DVR_CAPTURE_DATA_SEARCH" (command No.: 2554) and set the lpInBuffer to the request URI POST /ISAPI/AccessControl/OfflineCapture/DataCollections/searchTask?format=json for setting up persistent connection and set callback function (fRemoteConfigCallback) for searching for the collected data.

    2. Call NET_DVR_SendRemoteConfig to send the search condition message JSON_SearchTaskCond via the persistent connection.

      The collected data is returned in the structure NET_DVR_JSON_DATA_CFG by the output buffer (lpBuffer) of the callback function.

      Note:
    3. Call NET_DVR_StopRemoteConfig to disconnect the persistent connection and finishing searching.

    Delete A Specific Piece of Collected Data

    Call NET_DVR_STDXMLConfig to pass through the request URL: DELETE /ISAPI/AccessControl/OfflineCapture/DataCollections/<captureNo>?format=json.

    Delete All Collected Data

    Call NET_DVR_STDXMLConfig to pass through the request URL: DELETE /ISAPI/AccessControl/OfflineCapture/DataCollections?format=json.

Call NET_DVR_Logout and NET_DVR_Cleanup to log out of the device and release the resources.