Ken Van Hoeylandt c87200a80d
Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects
- Fix some issues here and there (found while moving things)
- All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
2025-02-01 18:13:20 +01:00

40 lines
822 B
C++

#include "Tactility/app/wificonnect/State.h"
#include <cstring>
namespace tt::app::wificonnect {
void State::setConnectionError(bool error) {
lock.lock();
connectionError = error;
lock.unlock();
}
bool State::hasConnectionError() const {
lock.lock();
auto result = connectionError;
lock.unlock();
return result;
}
void State::setApSettings(const service::wifi::settings::WifiApSettings* newSettings) {
lock.lock();
memcpy(&this->apSettings, newSettings, sizeof(service::wifi::settings::WifiApSettings));
lock.unlock();
}
void State::setConnecting(bool isConnecting) {
lock.lock();
connecting = isConnecting;
lock.unlock();
}
bool State::isConnecting() const {
lock.lock();
auto result = connecting;
lock.unlock();
return result;
}
} // namespace