Skip to content

Commit 66d648b

Browse files
committed
Small fix to method name
1 parent e8e43cd commit 66d648b

File tree

7 files changed

+61
-29
lines changed

7 files changed

+61
-29
lines changed

examples/esp8266WifiOled/Greenhouse.emf

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,23 @@
251251
"localOnly": true,
252252
"visible": true
253253
}
254+
},
255+
{
256+
"parentId": 9,
257+
"type": "enumItem",
258+
"item": {
259+
"enumEntries": [
260+
"Station",
261+
"Access Point"
262+
],
263+
"name": "WiFi Mode",
264+
"variableName": "WiFiMode",
265+
"id": 19,
266+
"eepromAddress": -1,
267+
"readOnly": false,
268+
"localOnly": false,
269+
"visible": true
270+
}
254271
}
255272
],
256273
"codeOptions": {
@@ -316,13 +333,8 @@
316333
"subsystem": "DISPLAY"
317334
},
318335
{
319-
"name": "PULLUP_LOGIC",
320-
"latestValue": "true",
321-
"subsystem": "INPUT"
322-
},
323-
{
324-
"name": "INTERRUPT_SWITCHES",
325-
"latestValue": "false",
336+
"name": "SW_POLLING_MODE",
337+
"latestValue": "SWITCHES_POLL_KEYS_ONLY",
326338
"subsystem": "INPUT"
327339
},
328340
{
@@ -355,6 +367,11 @@
355367
"latestValue": "-1",
356368
"subsystem": "INPUT"
357369
},
370+
{
371+
"name": "PULLUP_LOGIC",
372+
"latestValue": "true",
373+
"subsystem": "INPUT"
374+
},
358375
{
359376
"name": "ENCODER_IS_QUARTER_CYCLE",
360377
"latestValue": "false",
@@ -417,8 +434,12 @@
417434
"eepromDefinition": "eeprom:",
418435
"authenticatorDefinition": "rom:100:6",
419436
"projectIoExpanders": [
420-
"pcf8574:io8574:32:12",
421-
"deviceIO:"
422-
]
437+
"deviceIO:",
438+
"pcf8574:io8574:32:12"
439+
],
440+
"menuInMenuCollection": {
441+
"menuDefinitions": []
442+
},
443+
"packageNamespace": ""
423444
}
424445
}

examples/esp8266WifiOled/esp8266WifiOled.ino

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ void onCommsChange(CommunicationInfo info) {
5454
}
5555

5656
void startWiFi() {
57-
serdebugF3("Starting WiFi", menuSSID.getTextValue(), menuPwd.getTextValue());
58-
59-
// this sketch assumes you've successfully connected to the Wifi before, does not
60-
// call begin.. You can initialise the wifi whichever way you wish here.
61-
if(strlen(menuSSID.getTextValue())==0) {
57+
// You can choose between station and access point mode by setting the connectivity/Wifi Mode option to your
58+
// own choice
59+
if(menuWiFiMode.getCurrentValue() == 0) {
6260
// no SSID come up as an access point
6361
WiFi.mode(WIFI_AP);
6462
WiFi.softAP("tcmenu", "secret");

examples/esp8266WifiOled/esp8266WifiOled_menu.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ EthernetTagValTransport ethernetTransport;
2727
TagValueRemoteServerConnection ethernetConnection(ethernetTransport, ethernetInitialisation);
2828

2929
// Global Menu Item declarations
30+
const char enumStrWiFiMode_0[] PROGMEM = "Station";
31+
const char enumStrWiFiMode_1[] PROGMEM = "Access Point";
32+
const char* const enumStrWiFiMode[] PROGMEM = { enumStrWiFiMode_0, enumStrWiFiMode_1 };
33+
const PROGMEM EnumMenuInfo minfoWiFiMode = { "WiFi Mode", 19, 0xffff, 1, NO_CALLBACK, enumStrWiFiMode };
34+
EnumMenuItem menuWiFiMode(&minfoWiFiMode, 0, NULL);
3035
const PROGMEM char pgmStrAuthenticatorText[] = { "Authenticator" };
31-
EepromAuthenticationInfoMenuItem menuAuthenticator(pgmStrAuthenticatorText, NO_CALLBACK, 18, NULL);
36+
EepromAuthenticationInfoMenuItem menuAuthenticator(pgmStrAuthenticatorText, NO_CALLBACK, 18, &menuWiFiMode);
3237
const PROGMEM char pgmStrIoTMonitorText[] = { "IoT Monitor" };
3338
RemoteMenuItem menuIoTMonitor(pgmStrIoTMonitorText, 17, &menuAuthenticator);
3439
RENDERING_CALLBACK_NAME_INVOKE(fnIpAddressRtCall, ipAddressRenderFn, "IpAddress", -1, NO_CALLBACK)
@@ -84,16 +89,16 @@ void setupMenu() {
8489
menuIpAddress.setReadOnly(true);
8590
menuTomatoTemp.setReadOnly(true);
8691
menuCucumberTemp.setReadOnly(true);
87-
menuPwd.setLocalOnly(true);
8892
menuSSID.setLocalOnly(true);
93+
menuPwd.setLocalOnly(true);
8994
menuAuthenticator.setLocalOnly(true);
9095
menuIoTMonitor.setLocalOnly(true);
9196
menuSecretEntry.setVisible(false);
9297

9398
// Code generated by plugins.
9499
gfx.begin();
95100
renderer.setUpdatesPerSecond(10);
96-
switches.initialise(internalDigitalIo(), true);
101+
switches.init(internalDigitalIo(), SWITCHES_POLL_KEYS_ONLY, true);
97102
menuMgr.initForEncoder(&renderer, &menuTomatoTemp, 13, 12, 14);
98103
remoteServer.addConnection(&ethernetConnection);
99104
renderer.setTitleMode(BaseGraphicalRenderer::TITLE_FIRST_ROW);

examples/esp8266WifiOled/esp8266WifiOled_menu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include <RemoteMenuItem.h>
2020
#include <RuntimeMenuItem.h>
2121
#include <ScrollChoiceMenuItem.h>
22-
#include <IoAbstractionWire.h>
2322
#include <IoAbstraction.h>
23+
#include <IoAbstractionWire.h>
2424
#include <ArduinoEEPROMAbstraction.h>
2525
#include <RemoteAuthentication.h>
2626

@@ -36,6 +36,7 @@ extern EthernetInitialisation ethernetInitialisation;
3636
extern IoAbstractionRef ioexp_io8574;
3737

3838
// Global Menu Item exports
39+
extern EnumMenuItem menuWiFiMode;
3940
extern EepromAuthenticationInfoMenuItem menuAuthenticator;
4041
extern RemoteMenuItem menuIoTMonitor;
4142
extern IpAddressMenuItem menuIpAddress;

examples/keyboardEthernetShield/keyboardEthernetShield.emf

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,8 @@
508508
"subsystem": "DISPLAY"
509509
},
510510
{
511-
"name": "PULLUP_LOGIC",
512-
"latestValue": "true",
513-
"subsystem": "INPUT"
514-
},
515-
{
516-
"name": "INTERRUPT_SWITCHES",
517-
"latestValue": "false",
511+
"name": "SW_POLLING_MODE",
512+
"latestValue": "SWITCHES_POLL_EVERYTHING",
518513
"subsystem": "INPUT"
519514
},
520515
{
@@ -547,6 +542,11 @@
547542
"latestValue": "-1",
548543
"subsystem": "INPUT"
549544
},
545+
{
546+
"name": "PULLUP_LOGIC",
547+
"latestValue": "true",
548+
"subsystem": "INPUT"
549+
},
550550
{
551551
"name": "ENCODER_IS_QUARTER_CYCLE",
552552
"latestValue": "false",
@@ -616,6 +616,10 @@
616616
"projectIoExpanders": [
617617
"deviceIO:",
618618
"mcp23017:io23017:32:2"
619-
]
619+
],
620+
"menuInMenuCollection": {
621+
"menuDefinitions": []
622+
},
623+
"packageNamespace": ""
620624
}
621625
}

examples/keyboardEthernetShield/keyboardEthernetShield_menu.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,15 @@ void setupMenu() {
117117
lcd.setIoAbstraction(ioexp_io23017);
118118
lcd.begin(20, 4);
119119
renderer.setUpdatesPerSecond(4);
120-
switches.initialise(ioexp_io23017, true);
120+
switches.init(ioexp_io23017, SWITCHES_POLL_EVERYTHING, true);
121121
menuMgr.initForEncoder(&renderer, &menuTime, 6, 7, 5);
122122
remoteServer.addConnection(&ethernetConnection);
123123
remoteServer.addConnection(&ethernetConnection2);
124124

125125
// We have an IoT monitor, register the server
126126
menuConnectivityIoTMonitor.setRemoteServer(remoteServer);
127+
128+
// We have an EEPROM authenticator, it needs initialising
129+
menuConnectivityAuthenticator.init();
127130
}
128131

examples/keyboardEthernetShield/keyboardEthernetShield_menu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <ScrollChoiceMenuItem.h>
2121
#include <RemoteMenuItem.h>
2222
#include <EditableLargeNumberMenuItem.h>
23-
#include <IoAbstraction.h>
2423
#include <IoAbstractionWire.h>
24+
#include <IoAbstraction.h>
2525
#include <EepromAbstraction.h>
2626
#include <RemoteAuthentication.h>
2727
#include "tcMenuLiquidCrystal.h"

0 commit comments

Comments
 (0)