As I understand it, the security type for wireless can be one of the following:
typedef enum {
WLAN_SEC_UNSEC = 0,
WLAN_SEC_WEP,
WLAN_SEC_WPA,
WLAN_SEC_WPA2,
WLAN_SEC_WPA_ENTERPRISE,
WLAN_SEC_WPA2_ENTERPRISE,
WLAN_SEC_NOT_SET = 0xFF
} WLanSecurityType;
I’m writing some code that I want to be able to be run on any platform that supports wireless and print out the various WIFI configuration parameters. The code I’ve written compiles with all of the Gen3 platforms but fails to compile on a Photon. Here is the snippet of code that fails when compiling on a Photon:
for (int i = 0; i < found; i++)
{
Serial.printf("Network: %d\n", i);
Serial.print(" SSID: ");
Serial.println(ap[i].ssid);
// Security type
Serial.print(" Security: ");
switch (ap[i].security)
{
case WLAN_SEC_UNSEC:
Serial.println("Open");
break;
case WLAN_SEC_WEP:
Serial.println("WEP");
break;
case WLAN_SEC_WPA:
Serial.println("WPA");
break;
case WLAN_SEC_WPA2:
Serial.println("WPA2");
break;
case WLAN_SEC_WPA_ENTERPRISE:
Serial.println("WPA Enterprise");
break;
case WLAN_SEC_WPA2_ENTERPRISE:
Serial.println("WPA2 Enterprise");
break;
default:
Serial.println("Unknown");
break;
}
When compiling on the Photon, I get the following error messages:
whoami.ino:129:18: 'WLAN_SEC_WPA_ENTERPRISE' was not declared in this scope
whoami.ino:132:18: 'WLAN_SEC_WPA2_ENTERPRISE' was not declared in this scope
These enum values must be firmware version dependent? When I compile on a 0.6.3 Photon, I get the error messages. When I compile on a 0.7.0 Photon, there are no errors.
Am I correct in assuming that if I want to be able to check for these enum values for all possible platforms, I need to check for a minimum firmware version of 0.7.0 before I can reference these enums?