-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.cpp
65 lines (60 loc) · 2.15 KB
/
main.cpp
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
//#include "OnvifPTZ.h"
//#include "OnvifImaging.h"
#include "onvifdevice.h"
#include <unistd.h>
#include <vector>
using namespace std;
int main(){
//vector<string> addr;
//detectDevice(addr);
//for(vector<string>::iterator it = addr.begin(); it != addr.end(); ++it){
//cout<<"####"<<*it<<"####"<<endl;
//}
//string::size_type idx = (*it).find("192.168.8.220");
//if(idx == string::npos)
//continue;
//cout<<"####"<<*it<<"####"<<endl;
string it = "http://192.168.8.220/onvif/device_service";
string user = "admin";
string pass = "leinao123";
OnvifDevice onvifdevice(it,user,pass);
//int speed;
//OnvifPTZ.setPtzMoveSpeed(2);
//OnvifPTZ.getPtzMoveSpeed(speed);
//cout<<"speed: "<<speed<<endl;
//ImagingSet imageSet;
//OnvifPTZ.ptzContinuousMove(LEFT);
//OnvifPTZ.ptzContinuousStop();
//OnvifPTZ.ptzRelativeMove(UP);
//sleep(3);
//OnvifPTZ.SetPreset("3","onvif");
//vector<PreInfo> allpresets;
//onvifdevice.GetAllPresets(allpresets);
//for (int i=0;i<allpresets.size();i++){
// PreInfo preset = allpresets[i];
// cout<<"name :"<<preset.name<<endl;
// cout<<"token :"<<preset.token<<endl;
// cout<<"p :"<<preset.p<<endl;
// cout<<"t :"<<preset.t<<endl;
// cout<<"z :"<<preset.z<<endl;
//}
float x,y,z;
string prename;
onvifdevice.GetOnePresets("5",prename,x,y,z);
cout<<"prename: "<<prename<<endl;
cout<<"x: "<<x<<endl;
cout<<"y: "<<x<<endl;
cout<<"z: "<<x<<endl;
//OnvifImaging Imaging(it, user, pass);
//ImagingSet imageSet;
//Imaging.GetImagingSettings(imageSet);
//cout<<"ExposureTime: "<<imageSet.ExposureTime<<endl;
//onvifDevice.SetImagingSettings();
//string videoSourceToken;
//onvifDevice.GetVideoSources(videoSourceToken);
//cout<<"video :"<<videoSourceToken<<endl;
//onvifDevice.ContinuousFocusMove(0.1);
//sleep(2);
//onvifDevice.ContinuousFocusStop();
return 0;
}