Configure Region Entrance Alarm for Intelligent Device

For intelligent device, you should configure the analysis engine of device first, and then set rule, arming schedule, alarm linkage for a specific detection scene that may trigger region entrance alarm.

  • 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 API Calling Flow of Configuring Region Entrance Alarm for Intelligent Device

  1. Call NET_DVR_STDXMLConfig to transmit /ISAPI/System/capabilities by GET method for getting the device capability to check if the analysis engine configuration is supported.

    The device capability is returned in the message XML_DeviceCap by lpOutputParam.

    If the node <isSupportIntelligentAnalysisEngines> is returned in the message and its value is "true", it indicates that analysis engine configuration is supported, you can continue to perform this step.

    Otherwise, the analysis engine configuration is not supported by device, please end this task.

  2. Optional: Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/analysisEngines/<ID> by GET method for getting default or configured analysis engine parameters for reference.

    The analysis engine parameters is returned in the message XML_AnalysisEngine by lpOutputParam.

  3. Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/analysisEngines/<ID> by PUT method and set lpInputParam to XML_AnalysisEngine for setting the analysis engine parameters.
  4. Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/capabilities by GET method for getting intelligent channel capability to check if region entrance detection is supported.

    The intelligent channel capability is returned in the message XML_IntelliCap by lpOutputParam.

    If the node <isRegionEntranceSupport> is returned in the message and its value is "true", it indicates that region entrance detection is supported, you can continue to perform this step.

    Otherwise, the region entrance detection is not supported by device, please end this task.

  5. Configure region entrance detection rule for a detection scene by channel.
    1. Optional: Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/rule/capabilities by GET method for getting the region entrance detection rule capability.

      The region entrance detection rule capability is returned in the message XML_Cap_RuleInfo by lpOutputParam.

    2. Optional: Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/rule/<ID> by GET method for getting default or configured region entrance detection rule for reference.

      The region entrance detection rule parameters are returned in the message XML_RuleInfo by lpOutputParam.

    3. Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/rule/<ID> by PUT method and set lpInputParam to XML_RuleInfo for setting the region entrance detection rule of a specific detection scene.
  6. Configure alarm linkage for the region entrance detection of a detection scene by channel.
    1. Optional: Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/notifications by GET method for getting default or configured region entrance alarm linkage parameters for reference.

      The region entrance alarm linkage parameters are returned in the message XML_RuleNotification by lpOutputParam.

    2. Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/notifications by PUT method and set lpInputParam to XML_RuleNotification for setting the region entrance alarm linkage of a specific detection scene.
    Note:

    To receive the alarm in the platform, the linkage action must be set to "center" (upload to center).

  7. Configure arming schedule for the region entrance detection of a detection scene by channel.
    1. Optional: Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/schedules by GET method for getting default or configured region entrance arming schedule for reference.

      The arming schedule are returned in the message XML_RuleSchedule by lpOutputParam.

    2. Call NET_DVR_STDXMLConfig to transmit /ISAPI/Intelligent/channels/<ID>/behaviorRule/<SID>/schedules by PUT method and set lpInputParam to XML_RuleSchedule for setting arming schedule of a specific detection scene.
    Note:

    The above rules, arming schedule, and alarm linkage can also be configured by logging in to device via web browser.

  8. Optional: Set lCommand to "COMM_ALARM_RULE" (command No.: 0x1102) and set wEventTypeEx to "ENUM_VCA_EVENT_ENTER_AREA" in the alarm callback function to receive region entrance alarm in arming mode (see Receive Alarm/Event in Arming Mode) or listening mode (see Receive Alarm/Event in Listening Mode) when alarm is triggered.

    The received alarm details in the structure NET_VCA_RULE_ALARM.

Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release resources.