web_wifi example launch on btn press; comments

This commit is contained in:
p-sam 2019-02-05 16:59:36 +00:00
parent 39d0436880
commit 80b8bbd6aa

View File

@ -18,7 +18,7 @@ int main(int argc, char* argv[])
// This example uses a text console, as a simple way to output text to the screen. // This example uses a text console, as a simple way to output text to the screen.
// If you want to write a software-rendered graphics application, // If you want to write a software-rendered graphics application,
// take a look at the graphics/simplegfx example, which uses the libnx gfx API instead. // take a look at the graphics/simplegfx example, which uses the libnx Framebuffer API instead.
// If on the other hand you want to write an OpenGL based application, // If on the other hand you want to write an OpenGL based application,
// take a look at the graphics/opengl set of examples, which uses EGL instead. // take a look at the graphics/opengl set of examples, which uses EGL instead.
consoleInit(NULL); consoleInit(NULL);
@ -27,19 +27,11 @@ int main(int argc, char* argv[])
consoleUpdate(NULL); consoleUpdate(NULL);
WebWifiConfig config; printf("Press A to launch WebWifiAuth applet.\n");
// Set the initial URL that the applet will navigate too.
webWifiCreate(&config, "http://example.org/");
printf("Running webWifiShow...\n");
rc = webWifiShow(&config);
printf("webWifiShow(): 0x%x\n", rc);
printf("Press + to exit.\n"); printf("Press + to exit.\n");
// Main loop // Main loop
while (appletMainLoop())//This loop will automatically exit when applet requests exit. while (appletMainLoop())
{ {
// Scan all the inputs. This should be done once for each frame // Scan all the inputs. This should be done once for each frame
hidScanInput(); hidScanInput();
@ -51,6 +43,17 @@ int main(int argc, char* argv[])
if (kDown & KEY_PLUS) if (kDown & KEY_PLUS)
break; // break in order to return to hbmenu break; // break in order to return to hbmenu
if (kDown & KEY_A) {
WebWifiConfig config;
// Set the initial URL that the applet will navigate too.
webWifiCreate(&config, "http://example.org/");
printf("Running webWifiShow...\n");
rc = webWifiShow(&config);
printf("webWifiShow(): 0x%x\n", rc);
}
// Your code goes here // Your code goes here
// Update the console, sending a new frame to the display // Update the console, sending a new frame to the display