File tree Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -138,14 +138,10 @@ void setup(void) {
138
138
139
139
NW.onConfig ([&]() {
140
140
Serial.println (" NW onConfig Received" );
141
-
142
- String host, port;
143
- // Get values
144
- nw_mqtt_host.getValue (host);
145
- nw_mqtt_port.getValue (port);
146
- // Print values
147
- Serial.printf (" Host: %s\n " , host.c_str ());
148
- Serial.printf (" Port: %s\n " , port.c_str ());
141
+
142
+ // Print new parameter values
143
+ Serial.printf (" Host: %s\n " , nw_mqtt_host.getValueStr ().c_str ());
144
+ Serial.printf (" Port: %s\n " , nw_mqtt_port.getValueStr ().c_str ());
149
145
return true ; // <-- return true to approve request, false to reject
150
146
});
151
147
Original file line number Diff line number Diff line change @@ -128,14 +128,10 @@ void setup(void) {
128
128
129
129
NW.onConfig ([&]() {
130
130
Serial.println (" NW onConfig Received" );
131
-
132
- String host, port;
133
- // Get values
134
- nw_mqtt_host.getValue (host);
135
- nw_mqtt_port.getValue (port);
136
- // Print values
137
- Serial.printf (" Host: %s\n " , host.c_str ());
138
- Serial.printf (" Port: %s\n " , port.c_str ());
131
+
132
+ // Print new parameter values
133
+ Serial.printf (" Host: %s\n " , nw_mqtt_host.getValueStr ().c_str ());
134
+ Serial.printf (" Port: %s\n " , nw_mqtt_port.getValueStr ().c_str ());
139
135
return true ; // <-- return true to approve request, false to reject
140
136
});
141
137
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ const String& NetWizardParameter::getValue() {
24
24
return _value;
25
25
}
26
26
27
+ const String& NetWizardParameter::getValueStr () {
28
+ return _value;
29
+ }
30
+
27
31
void NetWizardParameter::getValue (String& value) {
28
32
value = _value;
29
33
}
Original file line number Diff line number Diff line change @@ -26,9 +26,11 @@ class NetWizardParameter {
26
26
27
27
const int getType ();
28
28
29
- [[deprecated(" Replaced by void getValue(String& value )" )]]
29
+ [[deprecated(" getValue has been replaced by getValueStr( )" )]]
30
30
const String& getValue ();
31
31
32
+ const String& getValueStr ();
33
+
32
34
void getValue (String& value);
33
35
34
36
void setValue (const String& value);
You can’t perform that action at this time.
0 commit comments