Initial commit
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user