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
+55
View File
@@ -0,0 +1,55 @@
#include "Device.h"
namespace PresenceDetection {
namespace Device {
Device::Device(int id, const std::string& wifiMacAddress, const std::string& bluetoothAddress) :
m_id(id),
m_wifiMacAddress(wifiMacAddress),
m_bluetoothMacAddress(bluetoothAddress),
m_online(false)
{
}
Device::~Device()
{
}
Device::Device(const Device& other)
{
m_id = other.m_id;
m_wifiMacAddress = other.m_wifiMacAddress;
m_bluetoothMacAddress = other.m_bluetoothMacAddress;
m_online = other.m_online;
}
int Device::ID() const
{
return m_id;
}
std::string Device::WifiMacAddress() const
{
return m_wifiMacAddress;
}
std::string Device::BluetoothMacAddress() const
{
return m_bluetoothMacAddress;
}
bool Device::Online() const
{
std::lock_guard<std::mutex> lock(m_mutex);
return m_online;
}
void Device::Online(bool online)
{
std::lock_guard<std::mutex> lock(m_mutex);
m_online = online;
}
} // namespace Device
} // namespace PresenceDetection