For smart device, you can call HCNetSDK APIs to set region entrance detection
and alarm parameters without passing through the request URLs.
Figure 1 API Calling Flow of
Configuring Region Entrance Alarm for Smart Device
-
Call NET_DVR_GetSTDAbility, and set dwAbilityType to "NET_DVR_GET_SMART_CAPABILITIES" (value: 3500)
for getting the smart device capability to check whether the region entrance
detection is supported.
The smart device capability is returned in the message XML_SmartCap by lpOutBuffer.
If the node <isSupportRegionEntrance> 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.
-
Configure region entrance detection rules (including all detection
regions).
- Optional:
Call NET_DVR_GetSTDAbility, set dwAbilityType to
"NET_DVR_GET_REGION_ENTRANCE_CAPABILITIES" (value: 3502), and set
lpCondBuffer to a 4-byte channel
No. for getting configuration capability of region entrance detection
rules.
- Optional:
Call NET_DVR_GetSTDConfig with
"NET_DVR_GET_REGION_ENTR_DETECTION" (command No.: 3503) and set
lpCondBuffer to a 4-byte channel
No. for getting default or configured region entrance detection rules
for reference.
-
Call NET_DVR_SetSTDConfig with
"NET_DVR_SET_REGION_ENTR_DETECTION" (command No.: 3504), set lpCondBuffer to a 4-byte channel No., and
set lpInBuffer to NET_DVR_REGION_ENTRANCE_DETECTION for setting region entrance detection
rules.
- Optional:
Configure parameters of a detection region.
- Optional:
Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_ENTR_REGION"
(command No.: 3505), and set lpCondBuffer to NET_DVR_SMART_REGION_COND for getting default or configured
parameters of a detection region for reference.
-
Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_ENTR_REGION"
(command No.: 3506), set lpCondBuffer
to NET_DVR_SMART_REGION_COND, and set lpInBuffer to NET_DVR_REGION_ENTRANCE_DETECTION for setting parameters of a detection
region.
-
Configure arming schedule of region entrance detection.
- Optional:
Call NET_DVR_GetSTDAbility, set dwAbilityType to
"NET_DVR_GET_REGION_ENTRANCE_SCHEDULE_CAPABILITIES" (value: 3584), and
set lpCondBuffer to a 4-byte channel
No. for getting arming schedule capability of region entrance
detection.
The arming schedule capability of region entrance
detection is returned in the message XML_Cap_Schedule by lpOutBuffer.
- Optional:
Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_ENTR_SCHEDULE"
(command No.: 3509), 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 entrance
detection for reference.
The arming schedule parameters of region entrance
detection are returned in the structure NET_DVR_EVENT_SCHEDULE by lpOutBuffer.
-
Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_ENTR_SCHEDULE"
(command No.: 3510), set lpCondBuffer
to a 4-byte channel No., and set lpInBuffer to NET_DVR_EVENT_SCHEDULE for setting arming schedule of region
entrance detection.
-
Configure alarm linkage for region entrance detection.
- Optional:
Call NET_DVR_GetSTDAbility, and set dwAbilityType to
"NET_DVR_GET_EVENT_TRIGGERS_CAPABILITIES" (value: 3501) for getting
alarm linkage capability.
- Optional:
Call NET_DVR_GetSTDConfig with "NET_DVR_GET_REGION_ENTR_TRIGGER"
(command No.: 3507) and set lpCondBuffer to 4-byte channel No. for getting default
or configured alarm linkage parameters for reference.
-
Call NET_DVR_SetSTDConfig with "NET_DVR_SET_REGION_ENTR_TRIGGER"
(command No.: 3508), set lpCondBuffer
to a 4-byte channel No., and set lpInBuffer to 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 entrance detection
parameters can also be configured by logging in to
device via web browser.
- 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.
Call NET_DVR_Logout and NET_DVR_Cleanup to log out and release resources.