Configure Region Exiting Alarm for Smart Device

For smart device, you can call HCNetSDK APIs to set region exiting 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 Region Exiting Alarm for Smart Device

  1. Call NET_DVR_GetSTDAbility, and set the capability type (dwAbilityType) to "NET_DVR_GET_SMART_CAPABILITIES" (value: 3500) for getting the smart device capability to check if region exiting detection is supported.

    The smart device capability is returned in the message XML_SmartCap by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

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

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

  2. Optional: Call NET_DVR_GetSTDAbility, set the capability type (dwAbilityType) to "NET_DVR_GET_REGION_EXITING_CAPABILITIES" (value: 3511), and set the condition buffer (lpCondBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. for getting region exiting detection capability.

    The region exiting detection capability is returned in the message XML_Cap_RegionExiting by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  3. Optional: Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_EXITING_DETECTION" (command No.: 3512) and set condition buffer (lpCondBuffer) of structure NET_DVR_STD_CONFIG to 4-byte channel No. for getting default or configured region exiting detection parameters for reference.

    The region exiting detection parameters are returned in the structure NET_DVR_REGION_EXITING_DETECTION by output buffer (lpOutBuffer) of structure NET_DVR_STD_CONFIG.

  4. Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_EXITING_DETECTION" (command No.: 3513), and set condition buffer (lpCondBuffer) and input buffer (lpInBuffer) of structure NET_DVR_STD_CONFIG to 4-byte channel No. and NET_DVR_REGION_EXITING_DETECTION for setting region exiting detection parameters.
  5. Optional: Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_EXITING_REGION" (command No.: 3514), and set condition buffer (lpCondBuffer) of structure NET_DVR_STD_ABILITY to NET_DVR_SMART_REGION_COND for getting default or configured detection region parameters for reference.

    The detection region parameters are returned in the structure NET_DVR_REGIONEXITING_REGION by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  6. Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_EXITING_REGION" (command No.: 3515), and set condition buffer (lpCondBuffer) and input buffer (lpInBuffer) of structure NET_DVR_STD_ABILITY to NET_DVR_SMART_REGION_COND and NET_DVR_REGIONEXITING_REGION for setting detection region parameters.
  7. Optional: Call NET_DVR_GetSTDAbility, set the capability type (dwAbilityType) to "NET_DVR_GET_REGION_EXITING_SCHEDULE_CAPABILITIES" (value: 3585), and set the condition buffer (lpCondBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. for getting arming schedule capability of region exiting detection.

    The arming schedule capability of region exiting detection is returned in the message XML_Cap_Schedule by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  8. Optional: Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_EXIT_SCHEDULE" (command No.: 3518), and set condition buffer (lpCondBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. for getting default or configured arming schedule parameters of region exiting detection for reference.

    The arming schedule parameters of region exiting detection are returned in the structure NET_DVR_EVENT_SCHEDULE by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  9. Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_EXIT_SCHEDULE" (command No.: 3519), and set condition buffer (lpCondBuffer) and input buffer (lpInBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. and NET_DVR_EVENT_SCHEDULE for setting arming schedule of region exiting detection.
  10. Optional: Call NET_DVR_GetSTDAbility, and set the capability type (dwAbilityType) to "NET_DVR_GET_EVENT_TRIGGERS_CAPABILITIES" (value: 3501) for getting alarm linkage capability.

    The alarm linkage capability is returned in the message XML_EventTriggersCap by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  11. Optional: Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_EXIT_TRIGGER" (command No.: 3516), and set condition buffer (lpCondBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. for getting default or configured alarm linkage parameters for reference.

    The alarm linkage parameters are returned in the structure NET_DVR_EVENT_TRIGGER by output buffer (lpOutBuffer) of structure NET_DVR_STD_ABILITY.

  12. Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_EXIT_TRIGGER" (command No.: 3517), and set condition buffer (lpCondBuffer) and input buffer (lpInBuffer) of structure NET_DVR_STD_ABILITY to 4-byte channel No. and NET_DVR_EVENT_TRIGGER, for setting alarm linkage.
    Note:
    • To receive the alarm in the platform, the linkage action must be set to "center" (upload to center).

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

  13. Optional: Receive region exiting 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.