Update Naming and Tests
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user