56 lines
941 B
C++
56 lines
941 B
C++
#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
|