Initial commit

This commit is contained in:
2020-05-04 14:54:28 +02:00
commit 2945e8f206
16 changed files with 294 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
../Makefile
+48
View File
@@ -0,0 +1,48 @@
#include "VStarCam/Finder.h"
#include <Logging.h>
#include <sstream>
#include <string>
int main(int argc, char** argv)
{
try
{
Logging::OpenLog();
Logging::SetLogMask(Logging::Severity::Info);
if (argc != 2)
{
std::stringstream ss;
ss << "Usage: " << argv[0] << " <ipaddress>";
Logging::Log(Logging::Severity::Error, ss.str());
return 1;
}
std::string ipAddress(argv[1]);
int port = 0;
VStarCam::Finder finder("192.168.101.100");
port = finder.GetPort(ipAddress);
if (port != 0)
{
std::stringstream ss;
ss << port;
Logging::Log(Logging::Severity::Error, ss.str());
return 0;
}
return 1;
}
catch (const std::exception& e)
{
std::stringstream ss;
ss << "ERROR: " << e.what() << std::endl;
Logging::Log(Logging::Severity::Error, ss.str());
return 1;
}
}