Skip to content

Commit 2f109c4

Browse files
committed
changes for review
1 parent c7bc146 commit 2f109c4

File tree

11 files changed

+28
-33
lines changed

11 files changed

+28
-33
lines changed

libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55
#include <ESP8266mDNS.h>
66
#include <EEPROM.h>
77

8-
boolean isIp(String str);
9-
String toStringIp(IPAddress ip);
10-
void loadCredentials();
11-
void saveCredentials();
12-
void handleRoot();
13-
boolean captivePortal();
14-
void handleWifi();
15-
void handleWifiSave();
16-
void handleNotFound();
17-
18-
198
/*
209
This example serves a "hello world" on a WLAN and a SoftAP at the same time.
2110
The SoftAP allow you to configure WLAN parameters at run time. They are not setup in the sketch but saved on EEPROM.

libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ ESP8266WebServer server(80);
4040

4141
const int led = 13;
4242

43-
void drawGraph();
44-
4543
void handleRoot() {
4644
digitalWrite(led, 1);
4745
char temp[400];

tests/host/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@ ARDUINO_LIBS := \
217217
) \
218218

219219
MOCK_ARDUINO_LIBS := \
220-
common/MockClientContextSocket.cpp \
221-
common/MockClientContext.cpp \
220+
common/ClientContextSocket.cpp \
221+
common/ClientContextTools.cpp \
222222
common/MockWiFiServerSocket.cpp \
223223
common/MockWiFiServer.cpp \
224-
common/MockUDPSocket.cpp \
225-
common/ArduinoWire.cpp \
224+
common/UdpContextSocket.cpp \
225+
common/MockWire.cpp \
226226
common/MockEsp.cpp \
227227
common/MockEEPROM.cpp \
228228
common/MockSPI.cpp \

tests/host/README.txt

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ run it:
3434
./bin/Blink -h
3535

3636

37-
Optional 'D=1' enables core debug.
37+
Optional 'D=1' enables core debug (same as IDE's tools menu)
38+
Optional 'OPTZ=-O2' will update gcc -O option (default is -Os, D=1 implies -O0)
39+
Optional 'FORCE32=0' will use native/default gcc (default is FORCE32=1 unless gcc-multilib is not detected)
3840

3941

4042
Non exhaustive list of working examples:
@@ -51,15 +53,16 @@ Compile other sketches:
5153
- CAVEAT: functions must be declared *before* being called (arduino builder is not around)
5254

5355
make D=1 ULIBDIRS=/path/to/your/arduino/libraries/lib1:/path/to/another/place/lib2 /path/to/your/sketchdir/sketch/sketch
54-
or
56+
or:
5557
ULIBDIRS=/path/to/your/arduino/libraries/lib1:/path/to/another/place/lib2 make D=1 /path/to/your/sketchdir/sketch/sketch
56-
or
57-
export ULIBDIRS=/path/to/your/arduino/libraries/lib1:/path/to/another/place/lib2
58-
make D=1 /path/to/your/sketchdir/sketch/sketch
59-
6058

61-
Build all examples with debug enabled (D=1): (not fully working yet)
62-
make D=1 examples
59+
or (preferred):
60+
export ULIBDIRS=/path/to/your/arduino/libraries/lib1:/path/to/another/place/lib2
61+
export D=1
62+
export OPTZ=-O2
63+
make clean
64+
make /path/to/your/sketchdir/sketch/sketch
65+
./bin/sketch/sketch
6366

6467

6568
Running a sketch
@@ -85,10 +88,11 @@ Make fun, propose PRs.
8588

8689
- spiffs in a file (done, need to initialize and check)
8790
- EEPROM in a file (partly done)
88-
- SDCARD on Host filesystem ?
91+
- SDCARD on Host filesystem ? or in an image ?
8992
- nice curses interface to display/change gpios ?
9093
- display device emulation (like ssd1306)
9194
- optionaly use arduino-builder ?
92-
- store sketch objects and binaries outside from the source directories
95+
- store sketch objects and binaries outside from the source directories (done for sketches)
9396
- compile and use lwIP on host
94-
#1715
97+
- easily debug HTTP classes
98+
- https://github.com/esp8266/Arduino/issues/1715

tests/host/common/ArduinoMain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ int main (int argc, char* const argv [])
133133
p.events = POLLIN;
134134
if (poll(&p, 1, 0) && p.revents == POLLIN)
135135
{
136-
fprintf(stderr, MOCK "UDP poll(%d) -> cb\n", (int)p.fd);
136+
fprintf(stderr, MOCK "UDP poll(%d) -> cb\r", (int)p.fd);
137137
udp.second->mock_cb();
138138
}
139139
}

tests/host/common/MockWiFiServer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939

4040
extern "C" const ip_addr_t ip_addr_any = IPADDR4_INIT(IPADDR_ANY);
4141

42-
#define int2pcb(x) ((tcp_pcb*)(long)(x))
43-
#define pcb2int(x) ((int)(long)(x))
42+
#define int2pcb(x) ((tcp_pcb*)(intptr_t)(x))
43+
#define pcb2int(x) ((int)(intptr_t)(x))
44+
45+
// lwIP API side of WiFiServer
4446

4547
WiFiServer::WiFiServer (IPAddress addr, uint16_t port)
4648
{

tests/host/common/MockWiFiServerSocket.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737
#include <poll.h>
3838
#include <unistd.h>
3939

40-
#define int2pcb(x) ((tcp_pcb*)(long)(x))
41-
#define pcb2int(x) ((int)(long)(x))
40+
#define int2pcb(x) ((tcp_pcb*)(intptr_t)(x))
41+
#define pcb2int(x) ((int)(intptr_t)(x))
42+
43+
// host socket internal side of WiFiServer
4244

4345
int serverAccept (int srvsock)
4446
{
File renamed without changes.

0 commit comments

Comments
 (0)