Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of standard labels and parameters #55

Closed
ifamed opened this issue Jul 11, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@ifamed
Copy link

commented Jul 11, 2019

Hi, @prampec .
How can I change the default labels ("Thing name", "AP password", "WiFi SSID", "WiFi password", "Startup delay (seconds)") for these parameters?
I will be grateful for the answer or for the implementation of this.

this->_thingNameParameter = IotWebConfParameter("Thing name", "iwcThingName", this->_thingName, IOTWEBCONF_WORD_LEN);

this->_apPasswordParameter = IotWebConfParameter("AP password", "iwcApPassword", this->_apPassword, IOTWEBCONF_WORD_LEN, "password");

this->_wifiSsidParameter = IotWebConfParameter("WiFi SSID", "iwcWifiSsid", this->_wifiSsid, IOTWEBCONF_WORD_LEN);

this->_wifiPasswordParameter = IotWebConfParameter("WiFi password", "iwcWifiPassword", this->_wifiPassword, IOTWEBCONF_WORD_LEN, "password");

this->_apTimeoutParameter = IotWebConfParameter("Startup delay (seconds)", "iwcApTimeout", this->_apTimeoutStr, IOTWEBCONF_WORD_LEN, "number", NULL, NULL, "min='1' max='600'", false);

@prampec

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2019

This will be a kind of under-the-hood trip.

So first of all, you need to access those variables. You can do it by e.g. IotWebConfParameter* thingNameParam = iotWebConf.getThingNameParameter();

With this you are already able to access the label, e.g.: Serial.println(thingNameParam->label);

Now, to modify the value of this value, you need to redirect the existing pointer to a new location. E.g. thingNameParam->label = "Alias for this device";

Please note, that the code above not tested. And I just hope, that the "new location" is constant indeed, so it will stay in memory after the actual scope ends.

@prampec prampec closed this Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.