﻿

{"id":16240,"date":"2023-10-07T16:05:13","date_gmt":"2023-10-07T07:05:13","guid":{"rendered":"https:\/\/www.bitstrong.com\/jp\/?p=16240"},"modified":"2024-01-12T09:56:12","modified_gmt":"2024-01-12T00:56:12","slug":"card-based-access-control-setting-multiple-callback-functions-to-receive-different-alarms-events-in-arming-mode","status":"publish","type":"post","link":"https:\/\/www.bitstrong.com\/jp\/card-based-access-control-setting-multiple-callback-functions-to-receive-different-alarms-events-in-arming-mode\/","title":{"rendered":"\u3010Card-Based Access Control\u3011Setting Multiple Callback Functions To Receive Different Alarms Events In Arming Mode"},"content":{"rendered":"<p><strong><span style=\"font-size: 18pt;\">\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/span><\/strong><\/p>\n<p>\/\/<br \/>\n\/\/ Device Network SDK (Card-Based Access Control)<br \/>\n\/\/ API Reference<br \/>\n\/\/ NET_DVR_SetDVRMessageCallBack_V50<br \/>\n\/\/ Sample Code of Setting Multiple Callback Functions to Receive Different Alarms\/Events in Arming Mode<br \/>\n\/\/<br \/>\n#include &lt;stdio.h&gt;<br \/>\n#include &lt;iostream&gt;<br \/>\n#include &#8220;Windows.h&#8221;<br \/>\n#include &#8220;HCNetSDK.h&#8221;<br \/>\nusing namespace std;<\/p>\n<p>int iNum=0;<br \/>\nvoid CALLBACK MessageCallbackNo1(LONG lCommand, NET_DVR_ALARMER *pAlarmer, char *pAlarmInfo, DWORD dwBufLen, void* pUser)<br \/>\n{<br \/>\nint i=0;<br \/>\nchar filename[100];<br \/>\nFILE *fSnapPic=NULL;<br \/>\nFILE *fSnapPicPlate=NULL;<\/p>\n<p>\/\/This sample code is for reference only. Actually, it is not recommended to process the data and save file in the callback function directly.<br \/>\n\/\/You&#8217;d better process the data in the message response funcion via message mode (PostMessage).<\/p>\n<p>switch(lCommand)<br \/>\n{<br \/>\ncase COMM_ALARM:<br \/>\n{<br \/>\nNET_DVR_ALARMINFO struAlarmInfo;<br \/>\nmemcpy(&amp;struAlarmInfo, pAlarmInfo, sizeof(NET_DVR_ALARMINFO));<br \/>\nswitch (struAlarmInfo.dwAlarmType)<br \/>\n{<br \/>\ncase 3: \/\/Motion detection alarm<br \/>\nfor (i=0; i&lt;16; i++) \/\/#define MAX_CHANNUM 16 \/\/The maximum number of channels<br \/>\n{<br \/>\nif (struAlarmInfo.dwChannel[i] == 1)<br \/>\n{<br \/>\nprintf(&#8220;Channel Number with Motion Detection Alarm %d\\n&#8221;, i+1);<br \/>\n}<br \/>\n}<br \/>\nbreak;<br \/>\ndefault:<br \/>\nbreak;<br \/>\n}<br \/>\nbreak;<br \/>\n}<\/p>\n<p>case COMM_UPLOAD_PLATE_RESULT:<br \/>\n{<br \/>\nNET_DVR_PLATE_RESULT struPlateResult={0};<br \/>\nmemcpy(&amp;struPlateResult, pAlarmInfo, sizeof(struPlateResult));<br \/>\nprintf(&#8220;License Plate Number: %s\\n&#8221;, struPlateResult.struPlateInfo.sLicense);\/\/License plate number<\/p>\n<p>switch(struPlateResult.struPlateInfo.byColor)\/\/License plate color<br \/>\n{<br \/>\ncase VCA_BLUE_PLATE:<br \/>\nprintf(&#8220;Vehicle Color: Blue\\n&#8221;);<br \/>\nbreak;<br \/>\ncase VCA_YELLOW_PLATE:<br \/>\nprintf(&#8220;Vehicle Color: Yellow\\n&#8221;);<br \/>\nbreak;<br \/>\ncase VCA_WHITE_PLATE:<br \/>\nprintf(&#8220;Vehicle Color: White\\n&#8221;);<br \/>\nbreak;<br \/>\ncase VCA_BLACK_PLATE:<br \/>\nprintf(&#8220;Vehicle Color: Black\\n&#8221;);<br \/>\nbreak;<br \/>\ndefault:<br \/>\nbreak;<br \/>\n}<\/p>\n<p>\/\/Scene picture<br \/>\nif (struPlateResult.dwPicLen != 0 &amp;&amp; struPlateResult.byResultType == 1 )<br \/>\n{<br \/>\nsprintf(filename,&#8221;testpic_%d.jpg&#8221;,iNum);<\/p>\n","protected":false},"excerpt":{"rendered":"\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0 \/\/ \/\/ Device Network SDK (Card-Based Access Control) \/\/ API Reference \/\/ NET_DVR_SetDVRMessageCallBack_V50 \/\/ Sample Code of Setting Multiple Ca...","protected":false},"author":4,"featured_media":15936,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[107],"tags":[],"class_list":["post-16240","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-camera-connection"],"_links":{"self":[{"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/16240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/comments?post=16240"}],"version-history":[{"count":1,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/16240\/revisions"}],"predecessor-version":[{"id":16241,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/16240\/revisions\/16241"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/media\/15936"}],"wp:attachment":[{"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/media?parent=16240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/categories?post=16240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/tags?post=16240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}