My platform is USI-09 and SDK 3.4.0
Before connecting to the AP, is there a way to know the AP's security type without scan?
Unfortunately, you would have to use scan to check the AP's security type beforehand. Once you are connected though you can check it using the function get_ap_info(), defined in command_console_wifi.c in libraries\utilities\command_console\wifi. Hope this helps.