For smart device, you can call HCNetSDK APIs to set line crossing detection
and alarm parameters without passing through the request URLs.
Figure 1 Programming Flow of Configuring Line Crossing Alarm for Smart
Device
-
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 line crossing detection is supported.
The event capability is returned in the message XML_EventAbility by output buffer
(pOutBuf).
If the node <TraversingVirtualPlane> is returned in the message, it
indicates that line crossing detection is supported, you can continue to
perform this step.
Otherwise, the line crossing detection is not supported by
device, please end this task.
- Optional:
Call NET_DVR_GetDeviceConfig with "NET_DVR_GET_TRAVERSE_PLANE_DETECTION"
(command No.: 3360), and set the input parameter pointer (pInBuffer) to multiple (i.e., the value of dwCount) structures NET_DVR_CHANNEL_GROUP for getting the line crossing detection
parameters, including detection rule, arming schedule, alarm linkage, and so on,
for reference.
-
Call NET_DVR_SetDeviceConfig with "NET_DVR_SET_TRAVERSE_PLANE_DETECTION"
(command No.: 3361), 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_TRAVERSE_PLANE_DETECTION for setting the line crossing detection
parameters.
Note:
-
To receive the alarm in the platform, the linkage
action must be set to "center" (upload to center).
-
The above line crossing detection parameters can also
be configured by logging in to device via web browser.
-
Receive line crossing 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.