Skip to content

Commit b195aa6

Browse files
committed
feat: add wifi setup to qa tests
1 parent 65523c0 commit b195aa6

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ async fn main(spawner: Spawner) {
142142
));
143143

144144
#[cfg(feature = "qa")]
145-
spawner.must_spawn(qa::qa_processor(global_state.clone()));
145+
{
146+
_ = nvs.invalidate_key(WIFI_NVS_KEY).await;
147+
spawner.must_spawn(qa::qa_processor(global_state.clone()));
148+
}
146149

147150
let mut wm_settings = esp_hal_wifimanager::WmSettings::default();
148151
wm_settings.ssid.clear();
@@ -185,6 +188,12 @@ async fn main(spawner: Spawner) {
185188
esp_hal::system::software_reset();
186189
};
187190

191+
#[cfg(feature = "qa")]
192+
{
193+
_ = nvs.invalidate_key(WIFI_NVS_KEY).await;
194+
crate::qa::send_qa_resp(crate::qa::QaSignal::WifiSetup);
195+
}
196+
188197
let conn_settings: ConnSettings = wifi_res
189198
.data
190199
.take()

src/qa.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub enum QaSignal {
1111
Rfid(u128),
1212
StackmatConnected,
1313
Stackmat(u64),
14+
WifiSetup,
1415
}
1516

1617
#[embassy_executor::task]
@@ -118,6 +119,19 @@ async fn qa_inner(global_state: &GlobalState) -> bool {
118119
return false;
119120
}
120121

122+
global_state.state.lock().await.custom_message = Some((
123+
format!("Setup WIFI"),
124+
format!("FKM-{:X}", crate::utils::get_efuse_u32()),
125+
));
126+
loop {
127+
let val = BACK_SIGNAL.wait().await;
128+
if let QaSignal::WifiSetup = val {
129+
break;
130+
}
131+
132+
return false;
133+
}
134+
121135
return true;
122136
}
123137

0 commit comments

Comments
 (0)