Add use of DomoticaServer API for Bluetooth Addresses
This commit is contained in:
@@ -126,14 +126,14 @@ int main(int argc, char** argv)
|
||||
std::shared_ptr<PresenceDetection::Bluetooth::Device> pBluetoothDevice;
|
||||
if (bluetooth)
|
||||
{
|
||||
std::string devices;
|
||||
boost::optional<boost::property_tree::ptree&> bluetoothDevices = pt.get_child_optional("Bluetooth.Devices");
|
||||
if (bluetoothDevices)
|
||||
devices = pt.get<std::string>("Bluetooth.Devices");
|
||||
std::string inventoryURL;
|
||||
boost::optional<boost::property_tree::ptree&> bluetoothInventoryURL = pt.get_child_optional("Bluetooth.Inventory");
|
||||
if (bluetoothInventoryURL)
|
||||
inventoryURL = pt.get<std::string>("Bluetooth.Inventory");
|
||||
else
|
||||
throw std::runtime_error("Bluetooth Devices directive missing in ini file.");
|
||||
throw std::runtime_error("Bluetooth Inventory directive missing in ini file.");
|
||||
|
||||
pBluetoothDevice = std::make_shared<PresenceDetection::Bluetooth::Device>(devices, target);
|
||||
pBluetoothDevice = std::make_shared<PresenceDetection::Bluetooth::Device>(inventoryURL, target);
|
||||
}
|
||||
|
||||
sigset_t wset;
|
||||
|
||||
Reference in New Issue
Block a user