@@ -43,7 +43,7 @@ HardwareSerial Serial2(2);
43
43
uint8_t CONFIG::FirmwareTarget = UNKNOWN_FW;
44
44
45
45
bool CONFIG::SetFirmwareTarget (uint8_t fw){
46
- if ( fw >= 0 && fw <= MAX_FW_ID) {
46
+ if ( fw <= MAX_FW_ID) {
47
47
FirmwareTarget = fw;
48
48
return true ;
49
49
} else return false ;
@@ -748,7 +748,7 @@ bool CONFIG::isHostnameValid(const char * hostname)
748
748
bool CONFIG::isSSIDValid (const char * ssid)
749
749
{
750
750
// limited size
751
- char c;
751
+ // char c;
752
752
if (strlen (ssid)>MAX_SSID_LENGTH || strlen (ssid)<MIN_SSID_LENGTH) {
753
753
return false ;
754
754
}
@@ -766,9 +766,12 @@ bool CONFIG::isSSIDValid(const char * ssid)
766
766
bool CONFIG::isPasswordValid (const char * password)
767
767
{
768
768
// limited size
769
- if (( strlen (password)>MAX_PASSWORD_LENGTH)|| ( strlen (password)<MIN_PASSWORD_LENGTH) ) {
769
+ if (strlen (password)>MAX_PASSWORD_LENGTH) {
770
770
return false ;
771
771
}
772
+ #if MIN_PASSWORD_LENGTH > 0
773
+ if (strlen (password)<MIN_PASSWORD_LENGTH)) return false ;
774
+ #endif
772
775
// no space allowed
773
776
for (int i=0 ; i < strlen (password); i++)
774
777
if (password[i] == ' ' ) {
@@ -1038,7 +1041,7 @@ bool CONFIG::check_update_presence( ){
1038
1041
count = 0 ;
1039
1042
String current_buffer;
1040
1043
String current_line;
1041
- int pos;
1044
+ // int pos;
1042
1045
int temp_counter = 0 ;
1043
1046
1044
1047
// pickup the list
@@ -1057,7 +1060,7 @@ bool CONFIG::check_update_presence( ){
1057
1060
while (current_buffer.indexOf (" \n " ) !=-1 ) {
1058
1061
// remove the possible "\r"
1059
1062
current_buffer.replace (" \r " ," " );
1060
- pos = current_buffer.indexOf (" \n " );
1063
+ // pos = current_buffer.indexOf("\n");
1061
1064
// get line
1062
1065
current_line = current_buffer.substring (0 ,current_buffer.indexOf (" \n " ));
1063
1066
// if line is command ack - just exit so save the time out period
@@ -1070,7 +1073,6 @@ bool CONFIG::check_update_presence( ){
1070
1073
if (current_line.indexOf (" busy:" ) > -1 || current_line.indexOf (" T:" ) > -1 || current_line.indexOf (" B:" ) > -1 ) {
1071
1074
temp_counter++;
1072
1075
} else {
1073
-
1074
1076
}
1075
1077
if (temp_counter > 5 ) {
1076
1078
break ;
@@ -1456,9 +1458,9 @@ void CONFIG::print_config(tpipe output, bool plaintext)
1456
1458
#endif
1457
1459
if (!plaintext)BRIDGE::print (F (" \" phy_mode\" :\" " ), output);
1458
1460
else BRIDGE::print (F (" Phy Mode: " ), output);
1459
- if (PhyMode == WIFI_PHY_MODE_11G )BRIDGE::print (F (" 11g" ), output);
1460
- else if (PhyMode == WIFI_PHY_MODE_11B )BRIDGE::print (F (" 11b" ), output);
1461
- else if (PhyMode == WIFI_PHY_MODE_11N )BRIDGE::print (F (" 11n" ), output);
1461
+ if (PhyMode == ( WIFI_PHY_MODE_11G) )BRIDGE::print (F (" 11g" ), output);
1462
+ else if (PhyMode == ( WIFI_PHY_MODE_11B) )BRIDGE::print (F (" 11b" ), output);
1463
+ else if (PhyMode == ( WIFI_PHY_MODE_11N) )BRIDGE::print (F (" 11n" ), output);
1462
1464
else BRIDGE::print (F (" ???" ), output);
1463
1465
if (!plaintext)BRIDGE::print (F (" \" ," ), output);
1464
1466
else BRIDGE::print (F (" \n " ), output);
0 commit comments