-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.cpp
37 lines (26 loc) · 997 Bytes
/
app.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
#include "app.h"
App::App()
{
}
void App::run()
{
app = new GVApplication();
app->discoverDevice();
foreach (PartnerDevice aDevice, app->getDiscoveredDevice()) {
std::cout<<aDevice.manufactureName.toStdString()<<std::endl;
std::cout<<aDevice.modelName.toStdString()<<std::endl;
std::cout<<aDevice.deviceVersion.toStdString()<<std::endl;
std::cout<<aDevice.macAddress.toStdString()<<std::endl;
std::cout<<aDevice.ipAddress.toString().toStdString()<<std::endl;
std::cout<<aDevice.subnetMask.toString().toStdString()<<std::endl;
std::cout<<aDevice.defaultGateway.toString().toStdString()<<std::endl;
}
PartnerDevice pdevice = app->getDiscoveredDevice().at(0);
pdevice.openControlChannel(5001);
while(pdevice.openStreamChannel(0)!=GEV_STATUS_SUCCESS) {};
Observer* obs = new Observer(pdevice.getStreamChannel(0));
while(true){};
pdevice.closeControlChannel();
delete obs;
delete app;
}