This commit is contained in:
LazarusMe 2026-07-08 22:43:11 +02:00 committed by GitHub
commit 91486c3c2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -289,9 +289,16 @@ void MainController::initInterface()
}
this->wifiController.createMonitorInteface();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
// The AP interface is only used by FTM. measure/inject operate on the monitor interface,
// which createMonitorInteface() has already tuned to the requested frequency. Creating the
// AP unconditionally makes its bring-up fail on no-IR channels (e.g. 5/6 GHz under the world
// regdomain 00), which throws and aborts the whole run.
if (Arguments::arguments.ftm || Arguments::arguments.ftmResponder)
{
this->wifiController.createApInteface();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
}
catch(const std::exception& e)
{
if (MainController::mainWindow)
@ -310,8 +317,12 @@ void MainController::initInterface()
void *MainController::measureCsi(void *arg)
{
try
{
// The AP interface only exists for FTM (see initInterface); don't touch it otherwise.
if (Arguments::arguments.ftm || Arguments::arguments.ftmResponder)
{
MainController::getInstance()->wifiController.setInterfaceUpDown(AP_INTERFACE_NAME, false);
}
MainController::getInstance()->wifiController.setInterfaceUpDown(MONITOR_INTERFACE_NAME, true);
WiFiCsiController wcs;
wcs.init();
@ -487,8 +498,12 @@ void *MainController::ftmResponder(void *arg)
void *MainController::injectPackets(void *arg)
{
try
{
// The AP interface only exists for FTM (see initInterface); don't touch it otherwise.
if (Arguments::arguments.ftm || Arguments::arguments.ftmResponder)
{
MainController::getInstance()->wifiController.setInterfaceUpDown(AP_INTERFACE_NAME, false);
}
MainController::getInstance()->wifiController.setInterfaceUpDown(MONITOR_INTERFACE_NAME, true);
PacketInjector pi;
if (Arguments::arguments.injectRepeat)