Remove Port directive from ini file
This commit is contained in:
@@ -65,13 +65,6 @@ int main(int argc, char** argv)
|
|||||||
close(STDERR_FILENO);
|
close(STDERR_FILENO);
|
||||||
}
|
}
|
||||||
|
|
||||||
int port;
|
|
||||||
boost::optional<boost::property_tree::ptree&> presenceDetectionPort = pt.get_child_optional("PresenceDetection.Port");
|
|
||||||
if (presenceDetectionPort)
|
|
||||||
port = pt.get<int>("PresenceDetection.Port");
|
|
||||||
else
|
|
||||||
throw std::runtime_error("Port directive missing in ini file.");
|
|
||||||
|
|
||||||
std::string target;
|
std::string target;
|
||||||
boost::optional<boost::property_tree::ptree&> presenceDetectionTarget = pt.get_child_optional("PresenceDetection.Target");
|
boost::optional<boost::property_tree::ptree&> presenceDetectionTarget = pt.get_child_optional("PresenceDetection.Target");
|
||||||
if (presenceDetectionTarget)
|
if (presenceDetectionTarget)
|
||||||
|
|||||||
+1
-1
@@ -35,7 +35,7 @@ static float tv2fl(struct timeval tv)
|
|||||||
return (float)(tv.tv_sec*1000.0) + (float)(tv.tv_usec/1000.0);
|
return (float)(tv.tv_sec*1000.0) + (float)(tv.tv_usec/1000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void stat(int sig)
|
static void stat(int /*sig*/)
|
||||||
{
|
{
|
||||||
int loss = sent_pkt ? (float)((sent_pkt-recv_pkt)/(sent_pkt/100.0)) : 0;
|
int loss = sent_pkt ? (float)((sent_pkt-recv_pkt)/(sent_pkt/100.0)) : 0;
|
||||||
printf("%d sent, %d received, %d%% loss\n", sent_pkt, recv_pkt, loss);
|
printf("%d sent, %d received, %d%% loss\n", sent_pkt, recv_pkt, loss);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
[PresenceDetection]
|
[PresenceDetection]
|
||||||
Port = 8000
|
|
||||||
Target =
|
Target =
|
||||||
UniFi = On
|
UniFi = On
|
||||||
Bluetooth = On
|
Bluetooth = On
|
||||||
|
|||||||
Reference in New Issue
Block a user