Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit 4a46019

Browse files
authored
Update README.md and use allman astyle
1 parent dbef57f commit 4a46019

18 files changed

+288
-157
lines changed

CONTRIBUTING.md

+26-7
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1515
Please ensure to specify the following:
1616

1717
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18-
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.56`)
19-
* `QNEthernet` library version (e.g. `QNEthernet v0.14.0`)
18+
* `Teensyduino` Core Version (e.g. `Teensyduino core v1.57`)
19+
* `QNEthernet` library version (e.g. `QNEthernet v0.16.0`)
2020
* Board type and relevant info
2121
* Contextual information (e.g. what you were trying to achieve)
2222
* Simplest possible steps to reproduce
@@ -29,13 +29,13 @@ Please ensure to specify the following:
2929

3030
```
3131
Arduino IDE version: 1.8.19
32-
Teensyduino core v1.56
33-
Teensy 4.1 using QNEthernet v0.14.0
32+
Teensyduino core v1.57
33+
Teensy 4.1 using QNEthernet v0.16.0
3434
OS: Ubuntu 20.04 LTS
35-
Linux xy-Inspiron-3593 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
35+
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3636
3737
Context:
38-
I encountered a crash while using TimerInterrupt.
38+
I encountered a crash while using this library
3939
4040
Steps to reproduce:
4141
1. ...
@@ -44,13 +44,32 @@ Steps to reproduce:
4444
4. ...
4545
```
4646

47+
---
48+
4749
### Sending Feature Requests
4850

4951
Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful.
5052

51-
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AsyncDNSServer_STM32/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
53+
There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/AsyncDNSServer_Teensy41/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them.
54+
55+
---
5256

5357
### Sending Pull Requests
5458

5559
Pull Requests with changes and fixes are also welcome!
5660

61+
Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux)
62+
63+
1. Change directory to the library GitHub
64+
65+
```
66+
xy@xy-Inspiron-3593:~$ cd Arduino/xy/AsyncDNSServer_Teensy41_GitHub/
67+
xy@xy-Inspiron-3593:~/Arduino/xy/AsyncDNSServer_Teensy41_GitHub$
68+
```
69+
70+
2. Issue astyle command
71+
72+
```
73+
xy@xy-Inspiron-3593:~/Arduino/xy/AsyncDNSServer_Teensy41_GitHub$ bash utils/restyle.sh
74+
```
75+

changelog.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
# AsyncDNSServer_Teensy41
1+
# AsyncDNSServer_Teensy41 Library
22

33

44
[![arduino-library-badge](https://www.ardu-badge.com/badge/AsyncDNSServer_Teensy41.svg?)](https://www.ardu-badge.com/AsyncDNSServer_Teensy41)
55
[![GitHub release](https://img.shields.io/github/release/khoih-prog/AsyncDNSServer_Teensy41.svg)](https://github.com/khoih-prog/AsyncDNSServer_Teensy41/releases)
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/AsyncDNSServer_Teensy41.svg)](http://github.com/khoih-prog/AsyncDNSServer_Teensy41/issues)
88

9+
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
11+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-AsyncDNSServer_Teensy41/count.svg" title="AsyncDNSServer_Teensy41 Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-AsyncDNSServer_Teensy41/count.svg" style="height: 30px;width: 200px;"></a>
14+
915
---
1016
---
1117

examples/AsyncCaptivePortal/AsyncCaptivePortal.ino

+16-11
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
AsyncCaptivePortal.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/
@@ -32,23 +32,27 @@ void handleNotFound(AsyncWebServerRequest *request)
3232
request->send(200, "text/html", responseHTML);
3333
}
3434

35-
void setup()
35+
void setup()
3636
{
3737
Serial.begin(115200);
38+
3839
while (!Serial);
3940

4041
delay(1000);
4142

42-
Serial.print("\nStart AsyncCaptivePortal on "); Serial.println(BOARD_NAME);
43+
Serial.print("\nStart AsyncCaptivePortal on ");
44+
Serial.println(BOARD_NAME);
4345
Serial.println(ASYNC_DNS_SERVER_TEENSY41_VERSION);
4446

4547
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
48+
4649
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
4750
{
4851
Serial.print("Warning. Must use this example on Version equal or later than : ");
4952
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
5053
}
51-
#endif
54+
55+
#endif
5256

5357
delay(500);
5458

@@ -81,14 +85,15 @@ void setup()
8185
else
8286
{
8387
apIP = Ethernet.localIP();
84-
85-
Serial.print(F("Connected! IP address:")); Serial.println(apIP);
88+
89+
Serial.print(F("Connected! IP address:"));
90+
Serial.println(apIP);
8691
//Serial.print(F("Connected! IP address:")); Serial.println(Ethernet.localIP());
8792
}
8893

8994
#if USING_DHCP
9095
delay(1000);
91-
#else
96+
#else
9297
delay(2000);
9398
#endif
9499

@@ -106,13 +111,13 @@ void setup()
106111
dnsServer.start(DNS_PORT, "*", apIP);
107112

108113
server.onNotFound(handleNotFound);
109-
114+
110115
server.begin();
111-
116+
112117
Serial.print(F("HTTP DNSServer is @ IP : "));
113118
Serial.println(apIP);
114119
}
115120

116-
void loop()
121+
void loop()
117122
{
118123
}

examples/AsyncCaptivePortal/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/

examples/AsyncCaptivePortalAdvanced/AsyncCaptivePortalAdvanced.ino

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
AsyncCaptivePortalAdvanced.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/
@@ -88,7 +88,7 @@ void handleRoot(AsyncWebServerRequest * request)
8888
request->send(response);
8989
}
9090

91-
// Redirect to captive portal if we got a request for another domain.
91+
// Redirect to captive portal if we got a request for another domain.
9292
// Return true in that case so the page handler do not try to handle the request again.
9393
bool captivePortal(AsyncWebServerRequest * request)
9494
{
@@ -144,20 +144,24 @@ void handleNotFound(AsyncWebServerRequest * request)
144144
void setup()
145145
{
146146
Serial.begin(115200);
147+
147148
while (!Serial);
148149

149150
delay(1000);
150151

151-
Serial.print("\nStart AsyncCaptivePortalAdvanced on "); Serial.println(BOARD_NAME);
152+
Serial.print("\nStart AsyncCaptivePortalAdvanced on ");
153+
Serial.println(BOARD_NAME);
152154
Serial.println(ASYNC_DNS_SERVER_TEENSY41_VERSION);
153155

154156
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
157+
155158
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
156159
{
157160
Serial.print("Warning. Must use this example on Version equal or later than : ");
158161
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
159162
}
160-
#endif
163+
164+
#endif
161165

162166
delay(500);
163167

@@ -190,17 +194,18 @@ void setup()
190194
else
191195
{
192196
apIP = Ethernet.localIP();
193-
194-
Serial.print(F("Connected! IP address:")); Serial.println(apIP);
197+
198+
Serial.print(F("Connected! IP address:"));
199+
Serial.println(apIP);
195200
}
196201

197202
#if USING_DHCP
198203
delay(1000);
199-
#else
204+
#else
200205
delay(2000);
201206
#endif
202207

203-
208+
204209

205210
// modify TTL associated with the domain name (in seconds)
206211
// default is 60 seconds

examples/AsyncCaptivePortalAdvanced/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/

examples/AsyncDNSServer/AsyncDNSServer.ino

+14-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
AsyncDNSServer.ino
33
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/
@@ -35,20 +35,24 @@ void handleNotFound(AsyncWebServerRequest *request)
3535
void setup()
3636
{
3737
Serial.begin(115200);
38+
3839
while (!Serial);
3940

4041
delay(1000);
4142

42-
Serial.print("\nStart AsyncDNSServer on "); Serial.println(BOARD_NAME);
43+
Serial.print("\nStart AsyncDNSServer on ");
44+
Serial.println(BOARD_NAME);
4345
Serial.println(ASYNC_DNS_SERVER_TEENSY41_VERSION);
4446

4547
#if defined(ASYNC_UDP_TEENSY41_VERSION_MIN)
48+
4649
if (ASYNC_UDP_TEENSY41_VERSION_INT < ASYNC_UDP_TEENSY41_VERSION_MIN)
4750
{
4851
Serial.print("Warning. Must use this example on Version equal or later than : ");
4952
Serial.println(ASYNC_UDP_TEENSY41_VERSION_MIN_TARGET);
5053
}
51-
#endif
54+
55+
#endif
5256

5357
delay(500);
5458

@@ -81,20 +85,21 @@ void setup()
8185
else
8286
{
8387
apIP = Ethernet.localIP();
84-
85-
Serial.print(F("Connected! IP address:")); Serial.println(apIP);
88+
89+
Serial.print(F("Connected! IP address:"));
90+
Serial.println(apIP);
8691
}
8792

8893
#if USING_DHCP
8994
delay(1000);
90-
#else
95+
#else
9196
delay(2000);
9297
#endif
9398

9499
// modify TTL associated with the domain name (in seconds)
95100
// default is 60 seconds
96101
dnsServer.setTTL(300);
97-
// set which return code will be used for all other domains
102+
// set which return code will be used for all other domains
98103
// (e.g. sending ServerFailure instead of NonExistentDomain will reduce number of queries
99104
// sent by clients). Default is AsyncDNSReplyCode::NonExistentDomain
100105
dnsServer.setErrorReplyCode(AsyncDNSReplyCode::ServerFailure);
@@ -110,6 +115,6 @@ void setup()
110115
Serial.println(apIP);
111116
}
112117

113-
void loop()
118+
void loop()
114119
{
115120
}

examples/AsyncDNSServer/defines.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/****************************************************************************************************************************
22
defines.h
3-
3+
44
For Teensy41 with QNEthernet
5-
5+
66
AsyncDNSServer_Teensy41 is a Async UDP library for the Teensy41 using built-in Ethernet and QNEThernet
7-
7+
88
Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
99
Built by Khoi Hoang https://github.com/khoih-prog/AsyncDNSServer_Teensy41
1010
*****************************************************************************************************************************/

0 commit comments

Comments
 (0)