add
heyujie
2021-10-13 3908255382982784cafadc27aa1592a5643c41c9
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
package hikvoice
 
/*
#cgo CFLAGS: -I${SRCDIR}/include -w -g
#cgo LDFLAGS: -L${SRCDIR}/libs
#cgo LDFLAGS: -lHikVoice -lAudioRender -lHCCore -lhcnetsdk -lhpr
#cgo LDFLAGS: -ldl -lm
 
#include <stdlib.h>
#include "Voice.h"
*/
import "C"
 
// type PtzDevice struct {
//     IpAddr string `form:"ipAddr" json:"ipAddr"`
//     Port string `form:"port" json:"port"`
//     UserName string `form:"userName" json:"userName"`
//     Password string `form:"password" json:"password"`
// }
 
// type PtzZoneService struct {
//     UserName string `form:"userName" json:"userName"`
//     Channel    string `form:"channel" json:"channel"`
//     XTop string `form:"xTop" json:"xTop"`
//     YTop string `form:"yTop" json:"yTop"`
//     XBottom string `form:"xBottom" json:"xBottom"`
//     YBottom string `form:"yBottom" json:"yBottom"`
// }
 
 
// SendVoice Send Voice
func PtzTrack(ip,password,port,userName string, channel,xBottom,xTop,yBottom,yTop int)  {
    
    //  // 初始化
    //  NET_DVR_Init();
 
    c.NET_DVR_Init()
    //  //设置连接时间与重连时间
    //  NET_DVR_SetConnectTime(2000, 1);
    //  NET_DVR_SetReconnect(10000, true);
    c.NET_DVR_SetConnectTime(2000, 1)
    c.NET_DVR_SetReconnect(10000, true)
    //  // 注册设备
    //  LONG lUserID;
 
    //  //登录参数,包括设备地址、登录用户、密码等
    //  NET_DVR_USER_LOGIN_INFO struLoginInfo = {0};
    //  struLoginInfo.bUseAsynLogin = 0; //同步登录方式
    //  strcpy(struLoginInfo.sDeviceAddress, "10.13.35.229"); //设备IP地址
    //  struLoginInfo.wPort = 8000; //设备服务端口
    //  strcpy(struLoginInfo.sUserName, "admin"); //设备登录用户名
    //  strcpy(struLoginInfo.sPassword, "abcd1234"); //设备登录密码
 
    //   //设备信息, 输出参数
    //   NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = {0};
 
    //   lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40);
 
    //   int iChannel = 1;//设备通道号
    // DWORD dwPTZCommand = PAN_LEFT; //云台左转
    // DWORD dwStop = 0; //开始转动
    // NET_DVR_PTZControl_Other(lUserID, iChannel, PAN_LEFT, dwStop)
 
    // //注销用户
    // NET_DVR_Logout(lUserID);
 
    // //释放SDK资源
    // NET_DVR_Cleanup();
 
}
 
 
func ToPreset(ip,password,port,userName string, ch int)  {
    c.NET_DVR_Init()
    //  //设置连接时间与重连时间
    //  NET_DVR_SetConnectTime(2000, 1);
    //  NET_DVR_SetReconnect(10000, true);
    c.NET_DVR_SetConnectTime(2000, 1)
    c.NET_DVR_SetReconnect(10000, true)
    //  // 注册设备
    //  LONG lUserID;
 
    //  //登录参数,包括设备地址、登录用户、密码等
    //  NET_DVR_USER_LOGIN_INFO struLoginInfo = {0};
    //  struLoginInfo.bUseAsynLogin = 0; //同步登录方式
    //  strcpy(struLoginInfo.sDeviceAddress, "10.13.35.229"); //设备IP地址
    //  struLoginInfo.wPort = 8000; //设备服务端口
    //  strcpy(struLoginInfo.sUserName, "admin"); //设备登录用户名
    //  strcpy(struLoginInfo.sPassword, "abcd1234"); //设备登录密码
 
    //   //设备信息, 输出参数
    //   NET_DVR_DEVICEINFO_V40 struDeviceInfoV40 = {0};
 
    //   lUserID = NET_DVR_Login_V40(&struLoginInfo, &struDeviceInfoV40);
 
    //   int iChannel = 1;//设备通道号
    // DWORD dwPTZCommand = PAN_LEFT; //云台左转
    // DWORD dwStop = 0; //开始转动
    // NET_DVR_PTZControl_Other(lUserID, iChannel, PAN_LEFT, dwStop)
 
    // //注销用户
    // NET_DVR_Logout(lUserID);
 
    // //释放SDK资源
    // NET_DVR_Cleanup();
    
}