-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceWifiAp.cpp
More file actions
39 lines (32 loc) · 922 Bytes
/
InterfaceWifiAp.cpp
File metadata and controls
39 lines (32 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @file InterfaceWifiAp.cpp
* @brief An interface for access point wifi only
*
* Wifi AP interface implementation
*
* @author Amine BAGGA (2025)
*/
#include <iostream>
#include "InterfaceWifiAp.h"
using namespace std;
InterfaceWifiAp::InterfaceWifiAp(const string& name) : Interface::Interface(name), m_apEnabled(false), m_connectedClients(0), m_mutex(new mutex()) {
}
InterfaceWifiAp::~InterfaceWifiAp() {
delete m_mutex;
}
void InterfaceWifiAp::setAp(const bool enable) {
lock_guard<mutex> lock(*m_mutex);
m_apEnabled = enable;
}
void InterfaceWifiAp::setConnectedClients(const int clients) {
lock_guard<mutex> lock(*m_mutex);
m_connectedClients = clients;
}
bool InterfaceWifiAp::getAp() const {
lock_guard<mutex> lock(*m_mutex);
return m_apEnabled;
}
int InterfaceWifiAp::getConnectedClients() const {
lock_guard<mutex> lock(*m_mutex);
return m_connectedClients;
}