During some code investigation, I found that break; actually breaks the application event loop and can not return to it when new Wlan state is registered, the Wlan API callback function receives different states.
For example:
It gets the wlan_notification_acm_connection_start state
Then it emits signal to displays button text, then it breaks from switch
New state is registered from the Wlan callback function, for example, wlan_notification_acm_connection_complete, but it can not return to this event anymore because it made a break early (it broke not only from the switch but also from this event loop). Also, possible to say it broke from the connect.
That is why, I changed it to if/else:
if (wlanNotificationData->NotificationCode == wlan_notification_acm_connection_start) {
if (wlanNotificationData->dwDataSize != sizeof(WLAN_CONNECTION_NOTIFICATION_DATA)) {
emit instance().notifDataSizeFailed();
return;
}
emit instance().apConnecting();
} else if (wlanNotificationData->NotificationCode == wlan_notification_acm_connection_complete) {
.....
}
Now it works well in Debug/Release modes. The issue is resolved.