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