﻿

{"id":16027,"date":"2023-10-07T17:00:13","date_gmt":"2023-10-07T08:00:13","guid":{"rendered":"https:\/\/www.bitstrong.com\/jp\/?p=16027"},"modified":"2024-01-12T09:42:08","modified_gmt":"2024-01-12T00:42:08","slug":"anpr-setting-multiple-callback-functions-to-receive-different-alarms-events-in-arming-mode","status":"publish","type":"post","link":"https:\/\/www.bitstrong.com\/jp\/anpr-setting-multiple-callback-functions-to-receive-different-alarms-events-in-arming-mode\/","title":{"rendered":"\u3010ANPR\u3011Setting Multiple Callback Functions To Receive Different Alarms Events In Arming Mode"},"content":{"rendered":"<p>\u30fb \u76ee\u6b21<br \/>\n\u25bc<a href=\"#fa1\">\u3010ANPR\u3011Setting Multiple Callback Functions To Receive Different Alarms Events In Arming Mode \u306e\u6982\u8981<\/a><br \/>\n\u25bc<a href=\"#fa2\">\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/a><\/p>\n<p><strong><span style=\"font-size: 18pt;\"><a id=\"fa1\"><\/a><br \/>\n\u3010ANPR\u3011Setting Multiple Callback Functions To Receive Different Alarms Events In Arming Mode \u306e\u6982\u8981<\/span><\/strong><\/p>\n<p>\u30a2\u30fc\u30df\u30f3\u30b0\u30e2\u30fc\u30c9\u3067\u7570\u306a\u308b\u30a2\u30e9\u30fc\u30e0\u3084\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u4fe1\u3059\u308b\u305f\u3081\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u3092\u8907\u6570\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><strong><span style=\"font-size: 18pt;\"><a id=\"fa2\"><\/a><br \/>\n\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/span><\/strong><\/p>\n<p>\/\/<br \/>\n\/\/ Device Network SDK (ANPR)<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":"\u30fb \u76ee\u6b21 \u25bc\u3010ANPR\u3011Setting Multiple Callback Functions To Receive Different Alarms Events In Arming Mode \u306e\u6982\u8981 \u25bc\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0 \u3010ANPR\u3011Setting Multiple Callback Functions...","protected":false},"author":2,"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-16027","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\/16027","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/comments?post=16027"}],"version-history":[{"count":1,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/16027\/revisions"}],"predecessor-version":[{"id":16029,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/16027\/revisions\/16029"}],"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=16027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/categories?post=16027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/tags?post=16027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}