Hello,
I would appreciate advice on the problem below.
While on one page I need to pass values to text boxes on another page and then show that page. The second page and text boxes have global scope. All of them are declared. But when executing all calls fail. This should be a simple code and I have no idea what is happening.
Thanks,
Michael
DECLARATIONS
NexPage WIFIPage(14, 0, “WIFIPage”);
NexText txtSSID(14,4,“txtSSID”);
NexText txtPwd(14,7,“txtPwd”);
// this is list of controls that we listen for events
NexTouch *nex_listen_list[] =
{
&cmdUpdateWF,
&cmdGo,
&cmdUpdateSet,
&cmdSetup,
NULL
};
CALLS IN SETUP
nexInit();
cmdGo.attachPop(cmdGoPopCallback);
delay(1000);
CALLS IN LOOP
nexLoop(nex_listen_list);
delay(1000);
CALLBACK FUNCTION
// this button click loads WIFI settings page
void cmdGoPopCallback(void *ptr)
{
char buffer[100] = {0};
char buffer2[100] = {0};
bool retval;
Serial.println(“cmdGoPopCallback executed”);
if (WIFICredentialsStored){
SSID.toCharArray(buffer,sizeof(buffer),0);
retval=txtSSID.setText(buffer);
if(!retval){
Serial.println("txtSSID.setText(buffer) failed");
}
Serial.println(buffer);
Password.toCharArray(buffer2,sizeof(buffer2),0);
retval=txtPwd.setText(buffer2);
if(!retval){
Serial.println("txtPwd.setText(buffer2) failed");
}
Serial.println(buffer2);
}
retval=WIFIPage.show();
if(!retval){
Serial.println("WIFIPage.show() failed");
}
}
OUTPUT:
cmdGoPopCallback executed
recvRetCommandFinished err
txtSSID.setText(buffer) failed
Fios-2RUKB
recvRetCommandFinished err
txtPwd.setText(buffer2) failed
jaw3750ads6142snow
recvRetCommandFinished err
WIFIPage.show() failed