﻿

{"id":15570,"date":"2023-10-07T11:43:34","date_gmt":"2023-10-07T02:43:34","guid":{"rendered":"https:\/\/www.bitstrong.com\/jp\/?p=15570"},"modified":"2023-12-13T10:06:22","modified_gmt":"2023-12-13T01:06:22","slug":"face-recognition-terminal-remotely-controlling-door","status":"publish","type":"post","link":"https:\/\/www.bitstrong.com\/jp\/face-recognition-terminal-remotely-controlling-door\/","title":{"rendered":"\u3010Face Recognition Terminal\u3011Remotely Controlling Door"},"content":{"rendered":"<p><strong><span style=\"font-size: 18pt;\">\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/span><\/strong><\/p>\n<div>\/\/<\/div>\n<div>\/\/ Device Network SDK (Face Recognition Terminal)<\/div>\n<div>\/\/ Manage Face Information<\/div>\n<div>\/\/ Remotely Control Door<\/div>\n<div>\/\/ Sample Code for Remotely Controlling Door<\/div>\n<div>\/\/<\/div>\n<div>#include &lt;stdio.h&gt;<\/div>\n<div>#include &lt;iostream&gt;<\/div>\n<div>#include &lt;afx.h&gt;<\/div>\n<div>#include &#8220;Windows.h&#8221;<\/div>\n<div>#include &#8220;HCNetSDK.h&#8221;<\/div>\n<p>using namespace std;<\/p>\n<div>void main()<\/div>\n<div>{<\/div>\n<div>\/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/div>\n<div>\/\/Initialize<\/div>\n<p>NET_DVR_Init();<\/p>\n<div>\/\/Set connection timeout and reconnection function<\/div>\n<div>NET_DVR_SetConnectTime(2000, 1);<\/div>\n<p>NET_DVR_SetReconnect(10000, true);<\/p>\n<div>\/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/div>\n<div>\/\/Initialize<\/div>\n<p>NET_DVR_Init();<\/p>\n<div>\/\/Set connection timeout and reconnection function<\/div>\n<div>NET_DVR_SetConnectTime(2000, 1);<\/div>\n<p>NET_DVR_SetReconnect(10000, true);<\/p>\n<div>\/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/div>\n<div>\/\/Log in to device<\/div>\n<div>LONG lUserID;<\/div>\n<div>\/\/Login parameters, including device IP address, user name, password, and so on<\/div>\n<div>NET_DVR_USER_LOGIN_INFO struLoginInfo = {0};<\/div>\n<div>struLoginInfo.bUseAsynLogin = 0; \/\/Synchronous login mode<\/div>\n<div>strcpy(struLoginInfo.sDeviceAddress, &#8220;192.168.1.64&#8221;); \/\/Device IP address<\/div>\n<div>struLoginInfo.wPort = 8000; \/\/Device service port number<\/div>\n<div>strcpy(struLoginInfo.sUserName, &#8220;admin&#8221;); \/\/User name<\/div>\n<p>strcpy(struLoginInfo.sPassword, &#8220;abcd1234&#8221;); \/\/Password<\/p>\n<div>\/\/Device information, output parameter<\/div>\n<div>NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = {0};<\/div>\n<p>lUserID = NET_DVR_Login_V40(&amp;struLoginInfo, &amp;struDeviceInfoV40);<\/p>\n<div>if (lUserID &lt; 0)<\/div>\n<div>{<\/div>\n<div>printf(&#8220;Login failed, error code: %d\\n&#8221;, NET_DVR_GetLastError());<\/div>\n<div>NET_DVR_Cleanup();<\/div>\n<div>return;<\/div>\n<p>}<\/p>\n<div>\/\/Open door, take door 1 as an example<\/div>\n<div>BOOL bRet;<\/div>\n<div>LONG lGatewayIndex = 1;\/\/Access controller No., starts from 1, -1: control all doors<\/div>\n<div>DWORD dwStaic = 1;\/\/Command No.: 0-Close, 1-Open, 2-Remain Open, 3-Remain Closed<\/div>\n<div>bRet = NET_DVR_ControlGateway(lUserID,lGatewayIndex,dwStaic);<\/div>\n<div>if (!bRet)<\/div>\n<div>{<\/div>\n<div>printf(&#8220;NET_DVR_ControlGateway failed, error:%d\\n&#8221;,NET_DVR_GetLastError());<\/div>\n<div>NET_DVR_Logout(lUserID);<\/div>\n<div>NET_DVR_Cleanup();<\/div>\n<div>return;<\/div>\n<p>}<\/p>\n<div>\/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/div>\n<div>\/\/Exit<\/div>\n<p>Sleep(5000);<\/p>\n<div>\/\/Log out<\/div>\n<div>NET_DVR_Logout(lUserID);<\/div>\n<div>\/\/Release SDK resource<\/div>\n<div>NET_DVR_Cleanup();<\/div>\n<div>return;<\/div>\n<div>}<\/div>\n","protected":false},"excerpt":{"rendered":"\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0 \/\/ \/\/ Device Network SDK (Face Recognition Terminal) \/\/ Manage Face Information \/\/ Remotely Control Door \/\/ Sample Code for Remotely Controlling...","protected":false},"author":2,"featured_media":15936,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[107],"tags":[],"class_list":["post-15570","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\/15570","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=15570"}],"version-history":[{"count":4,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/15570\/revisions"}],"predecessor-version":[{"id":15743,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/posts\/15570\/revisions\/15743"}],"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=15570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/categories?post=15570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bitstrong.com\/jp\/wp-json\/wp\/v2\/tags?post=15570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}