Implement use of Inventory API

This commit is contained in:
2019-04-23 11:41:34 +02:00
parent ea71693886
commit 5724bd45a7
9 changed files with 184 additions and 62 deletions
+8 -1
View File
@@ -113,7 +113,14 @@ int main(int argc, char** argv)
else
throw std::runtime_error("UniFi CookieFile directive missing in ini file.");
pUniFiDevice = std::make_shared<PresenceDetection::UniFi::Device>(hostname, username, password, cookiefile, target);
std::string inventoryURL;
boost::optional<boost::property_tree::ptree&> bluetoothInventoryURL = pt.get_child_optional("UniFi.Inventory");
if (bluetoothInventoryURL)
inventoryURL = pt.get<std::string>("UniFi.Inventory");
else
throw std::runtime_error("UniFi Inventory directive missing in ini file.");
pUniFiDevice = std::make_shared<PresenceDetection::UniFi::Device>(hostname, username, password, cookiefile, inventoryURL, target);
}
std::shared_ptr<PresenceDetection::Bluetooth::Device> pBluetoothDevice;