@@ -49,24 +49,24 @@ extern "C" {
49
49
* @param p Print interface
50
50
*/
51
51
void ESP8266WiFiClass::printDiag (Print& p) {
52
- const char * modes[] = { " NULL" , " STA" , " AP" , " STA+AP" };
53
- p.print (" Mode: " );
52
+ const char * const modes[] = { " NULL" , " STA" , " AP" , " STA+AP" };
53
+ p.print (F ( " Mode: " ) );
54
54
p.println (modes[wifi_get_opmode ()]);
55
55
56
- const char * phymodes[] = { " " , " B" , " G" , " N" };
57
- p.print (" PHY mode: " );
56
+ const char * const phymodes[] = { " " , " B" , " G" , " N" };
57
+ p.print (F ( " PHY mode: " ) );
58
58
p.println (phymodes[(int ) wifi_get_phy_mode ()]);
59
59
60
- p.print (" Channel: " );
60
+ p.print (F ( " Channel: " ) );
61
61
p.println (wifi_get_channel ());
62
62
63
- p.print (" AP id: " );
63
+ p.print (F ( " AP id: " ) );
64
64
p.println (wifi_station_get_current_ap_id ());
65
65
66
- p.print (" Status: " );
66
+ p.print (F ( " Status: " ) );
67
67
p.println (wifi_station_get_connect_status ());
68
68
69
- p.print (" Auto connect: " );
69
+ p.print (F ( " Auto connect: " ) );
70
70
p.println (wifi_station_get_auto_connect ());
71
71
72
72
struct station_config conf;
@@ -75,22 +75,14 @@ void ESP8266WiFiClass::printDiag(Print& p) {
75
75
char ssid[33 ]; // ssid can be up to 32chars, => plus null term
76
76
memcpy (ssid, conf.ssid , sizeof (conf.ssid ));
77
77
ssid[32 ] = 0 ; // nullterm in case of 32 char ssid
78
-
79
- p.print (" SSID (" );
80
- p.print (strlen (ssid));
81
- p.print (" ): " );
82
- p.println (ssid);
78
+ p.printf_P (PSTR (" SSID (%d): %s\n " ), strlen (ssid), ssid);
83
79
84
80
char passphrase[65 ];
85
81
memcpy (passphrase, conf.password , sizeof (conf.password ));
86
82
passphrase[64 ] = 0 ;
83
+ p.printf_P (PSTR (" Passphrase (%d): %s\n " ), strlen (passphrase), passphrase);
87
84
88
- p.print (" Passphrase (" );
89
- p.print (strlen (passphrase));
90
- p.print (" ): " );
91
- p.println (passphrase);
92
-
93
- p.print (" BSSID set: " );
85
+ p.print (F (" BSSID set: " ));
94
86
p.println (conf.bssid_set );
95
87
96
88
}
0 commit comments