Alarm Module¶
This version of the alarm for the "defensive" alarm mode: refers to the SDK actively connected to the device, and initiate the alarm upload command, equipment alarm immediately sent to the SDK
Interface Overview¶
| interface Name | Functional Description |
|---|---|
NET_SDK_SetupAlarmChan | Configure Alarms |
NET_SDK_SetDVRMessageCallBack | DVR Alarm or Status Callback |
NET_SDK_CloseAlarmChan | Close the alarm |
Process Description¶
---
title: Alarm Module Flow
---
flowchart TD
line1(Device SDK initialization<br><strong>NET_SDK_Init</strong>)
line2(User registration device<br><strong>NET_SDK_Login</strong> or<br><strong>NET_SDK_LoginEx</strong>)
line3(Configure alarm conditions and processing methods)
line4(Alarm or status callback<br><strong>NET_SDK_SetDVRMessageCallBack</strong>)
line5(Set alarm<br><strong>NET_SDK_SetupAlarmChan</strong>)
line6(Close alarm<br><strong>NET_SDK_CloseAlarmChan</strong>)
line7("Deregister device<br><strong>NET_SDK_Logout</strong>")
line8("Release SDK resources<br><strong>NET_SDK_Cleanup</strong>")
line1 --> line2 --> line3 --> line4 -->line5 -->line6 -->line7 -->line8 Sample Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
Relevant Instructions¶
The orange colored box is a necessary condition for uploading alarm information, mainly completing the configuration of related alarm conditions and processing methods, the interfaces for parameter configuration are NET_SDK_GetDVRConfig and NET_SDK_SetDVRConfig, and the configuration structure for semaphore alarm is NET_SDK_ALARMINFO .
If these parameters have been configured, the next step is to set the arming NET_SDK_SetupAlarmChan, and then call the alarm callback function NET_SDK_SetDVRMessageCallBack
After the entire alarm upload process is completed, it is also necessary to call the defence interface and other operations.