Update Naming and Tests

This commit is contained in:
2021-07-28 16:23:27 +02:00
parent f03e90f5b9
commit 03b00fa6de
17 changed files with 566 additions and 104 deletions
+4 -4
View File
@@ -43,8 +43,8 @@ bool Functions::Ping(const std::string& macAddress)
str2ba(macAddress.c_str(), &socketAddress.l2_bdaddr);
struct timeval timeoutStruct;
timeoutStruct.tv_sec = 3;
timeoutStruct.tv_usec = 0;
timeoutStruct.tv_sec = 1;
timeoutStruct.tv_usec = 0; //500000;
fd_set writeDescriptor, errorDescriptor;
FD_ZERO(&writeDescriptor);
@@ -68,7 +68,7 @@ bool Functions::Ping(const std::string& macAddress)
if (ret != 0)
{
if (select(socketDescriptor + 1, &errorDescriptor, &writeDescriptor, NULL, &timeoutStruct) < 0)
if (select(socketDescriptor + 1, &errorDescriptor, &writeDescriptor, NULL, &timeoutStruct) <= 0)
return false;
int error = 0;
@@ -125,7 +125,7 @@ bool Functions::Ping(const std::string& macAddress)
pf[0].events = POLLIN;
int err;
int timeout = 500;
int timeout = 200;
if ((err = poll(pf, 1, timeout)) < 0)
throw std::runtime_error("Poll failed");