Configure Intrusion Alarm for Smart Device

For smart device, you can call HCNetSDK APIs to set intrusion detection and alarm parameters without passing through the request URLs.

  • 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 Configuring Intrusion Alarm for Smart Device

  1. Call NET_DVR_GetDeviceAbility, set the capability type (dwAbilityType) to "DEVICE_ABILITY_INFO", and set the input buffer (pInBuf) to XML_Desc_EventAbilityfor getting the event capability to check if intrusion detection is supported.

    The event capability is returned in the message XML_EventAbility by output buffer (pOutBuf).

    If the node <FieldDetection> is returned in the message, it indicates that intrusion detection is supported, you can continue to perform this step.

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

  2. Optional: Call NET_DVR_GetDeviceConfig with "NET_DVR_GET_FIELD_DETECTION" (command No.: 3362), and set the input parameter pointer (pInBuffer) to multiple (i.e., the value of dwCount) structures NET_DVR_CHANNEL_GROUP for getting the intrusion detection parameters, including detection rule, arming schedule, alarm linkage, and so on, for reference.

    The intrusion detection parameters is returned in the structure NET_VCA_FIELDDETECION by output parameter lpOutBuffer.

  3. Call NET_DVR_SetDeviceConfig with "NET_DVR_SET_FIELD_DETECTION" (command No.: 3363), set the input parameter pointer (pInBuffer) to multiple (i.e., the value of dwCount) structures NET_DVR_CHANNEL_GROUP, and set the input parameter (lpInParamBuffer) to the structure NET_VCA_FIELDDETECION for setting the intrusion detection parameters.
    Note:
    • To receive the alarm in the platform, the linkage action must be set to "center" (upload to center).

    • The above intrusion detection parameters can also be configured by logging in to device via web browser.

  4. Receive intrusion 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.
    Note:

Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release resources.