Intelligent Alarm¶
Alarm subscription process: It refers to the SDK actively connecting to the device and subscribing to the device for alarms. If the device experiences an alarm, it will be immediately sent to the SDK.
Interface Overview¶
| interface Name | Functional Description |
|---|---|
NET_SDK_GetIVMRuleConfig | Obtain intelligent configuration information for devices (only - supports IPC) |
NET_SDK_SetIVMRuleConfig | Set intelligent configuration information for devices (only - supports IPC) |
NET_SDK_SmartSubscrib | Subscribe alarms |
NET_SDK_UnSmartSubscrib | UnSubscribe alarms |
NET_SDK_SetSubscribCallBack | Set the registration alarm callback function |
Process Description¶
---
title: Smart Alarm Process
---
flowchart TD
A(Device SDK initialization <br><strong>NET_SDK_Init</strong>)
B(User registers device <br><strong>NET_SDK_Login</strong> or <br><strong>NET_SDK_LoginEx</strong>)
subgraph Subscribe/Unsubscribe
direction LR
C(Subscribe to alarm <br><strong>NET_SDK_SmartSubscribe</strong>)
D(Unsubscribe to alarm <br><strong>NET_SDK_UnsmartSubscribe</strong>)
C --> D
end
E(Register alarm callback function <br><strong>NET_SDK_SetSubscribeCallBack</strong>)
F(Unregister device <br><strong>NET_SDK_Logout</strong>)
G(Release SDK resources <br><strong>NET_SDK_Cleanup</strong>)
A --> B --> E --> Subscribe/Unsubscribe --> F --> G -
Initialization interface
NET_SDK_InitCalled at the beginning of a program, a program only needs to be called once. -
Users register and login the device, calling
NET_SDK_LoginInterface,Each device only needs to be login once. -
Set alarm callback function
NET_SDK_SetSubscribCallBack. -
Set subscription type to subscrib alarm
NET_SDK_SmartSubscribThe dashed box section is a necessary condition for uploading alarm information, mainly for configuring alarm deployment. If the alarm deployment is already configured, the dashed box section can be omitted. -
After configuring relevant parameters and linkage methods, the device will automatically detect according to the configured rules. The SDK can obtain the identification results uploaded by the device through alarm deployment. Different device configurations may have different interfaces.
-
Called when exiting the program
NET_SDK_LogoutLogout the device. -
Call
NET_SDK_CleanupRelease all SDK resources.
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 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |