App improvements (#105)

This commit is contained in:
Ken Van Hoeylandt
2024-12-04 23:06:03 +01:00
committed by GitHub
parent fb45790927
commit e86a11b7e2
29 changed files with 358 additions and 107 deletions
@@ -116,6 +116,25 @@ WifiRadioState getRadioState() {
return state;
}
std::string getConnectionTarget() {
lock(wifi_singleton);
std::string result;
switch (wifi_singleton->radio_state) {
case WIFI_RADIO_CONNECTION_PENDING:
case WIFI_RADIO_CONNECTION_ACTIVE:
result = wifi_singleton->connection_target.ssid;
break;
case WIFI_RADIO_ON:
case WIFI_RADIO_ON_PENDING:
case WIFI_RADIO_OFF_PENDING:
case WIFI_RADIO_OFF:
result = "";
break;
}
unlock(wifi_singleton);
return result;
}
void scan() {
TT_LOG_I(TAG, "scan()");
tt_assert(wifi_singleton);
@@ -723,7 +742,6 @@ _Noreturn int32_t wifi_main(TT_UNUSED void* parameter) {
WifiMessage message;
while (true) {
TT_LOG_I(TAG, "Message queue %ld", queue.getCount());
if (queue.get(&message, 10000 / portTICK_PERIOD_MS) == TtStatusOk) {
TT_LOG_I(TAG, "Processing message of type %d", message.type);
switch (message.type) {