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

Commit 47f2d35

Browse files
authored
v1.0.1
### New in v1.0.1 1. Add support to ENC28J60 Ethernet module/shield using UIPEthernet library. 2. Fix bugs 3. Optimize code 4. Enhance examples 5. Add UIPEthernet Library Patches for SAMD21/SAMD51
1 parent 058cc62 commit 47f2d35

12 files changed

+218
-105
lines changed

src/MySQL_Generic_Connection.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1515
Licensed under MIT license
16-
Version: 1.0.0
16+
Version: 1.0.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
2020
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
21-
WiFiNINA and ESP8266/ESP32-AT shields
21+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
22+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2223
**********************************************************************************************************************************/
2324

2425
/*********************************************************************************************************************************

src/MySQL_Generic_Connection_Impl.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1515
Licensed under MIT license
16-
Version: 1.0.0
16+
Version: 1.0.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
2020
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
21-
WiFiNINA and ESP8266/ESP32-AT shields
21+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
22+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2223
**********************************************************************************************************************************/
2324

2425
/*********************************************************************************************************************************
@@ -70,6 +71,9 @@ bool MySQL_Connection::connect(IPAddress server, int port, char *user, char *pas
7071
int retries = MAX_CONNECT_ATTEMPTS;
7172

7273
MYSQL_LOGERROR3("Connecting to Server:", server, ", Port = ", port);
74+
75+
if (db)
76+
MYSQL_LOGERROR1("Using Database:", db);
7377

7478
// Retry up to MAX_CONNECT_ATTEMPTS times.
7579
while (retries--)
@@ -127,6 +131,9 @@ Connection_Result MySQL_Connection::connectNonBlocking(IPAddress server, int por
127131

128132
MYSQL_LOGERROR3("Connecting to Server:", server, ", Port = ", port);
129133

134+
if (db)
135+
MYSQL_LOGERROR1("Using Database:", db);
136+
130137
while (retries--)
131138
{
132139
if ( (now == 0) || ( millis() - now ) > CONNECT_DELAY_MS )

src/MySQL_Generic_Debug.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1515
Licensed under MIT license
16-
Version: 1.0.0
16+
Version: 1.0.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
2020
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
21-
WiFiNINA and ESP8266/ESP32-AT shields
21+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
22+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2223
**********************************************************************************************************************************/
2324

2425
/*********************************************************************************************************************************

src/MySQL_Generic_Encrypt_Sha1.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
1515
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1616
Licensed under MIT license
17-
Version: 1.0.0
17+
Version: 1.0.1
1818
1919
Version Modified By Date Comments
2020
------- ----------- ---------- -----------
2121
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
22-
WiFiNINA and ESP8266/ESP32-AT shields
22+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
23+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2324
**********************************************************************************************************************************/
2425

2526
#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_H

src/MySQL_Generic_Encrypt_Sha1_Impl.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
1515
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1616
Licensed under MIT license
17-
Version: 1.0.0
17+
Version: 1.0.1
1818
1919
Version Modified By Date Comments
2020
------- ----------- ---------- -----------
2121
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
22-
WiFiNINA and ESP8266/ESP32-AT shields
22+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
23+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2324
**********************************************************************************************************************************/
2425

2526
#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_IMPL_H

src/MySQL_Generic_Ethernet.h

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
1212
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1313
Licensed under MIT license
14-
Version: 1.0.0
14+
Version: 1.0.1
1515
1616
Version Modified By Date Comments
1717
------- ----------- ---------- -----------
1818
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
19-
(using Ethernet, EthernetLarge, Ethernet2, Ethernet3 library) and WiFiNINA
19+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
20+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2021
**********************************************************************************************************************************/
2122

2223
#ifndef MYSQL_GENERIC_ETHERNET_H
@@ -27,38 +28,47 @@
2728
#if USE_ETHERNET
2829
#include "Ethernet.h"
2930
EthernetClient client;
30-
#warning Use Ethernet lib
31+
#warning Using Ethernet lib
3132
#elif USE_ETHERNET_LARGE
3233
#include "EthernetLarge.h"
3334
EthernetClient client;
34-
#warning Use EthernetLarge lib
35+
#warning Using EthernetLarge lib
3536
#elif USE_ETHERNET2
3637
#include "Ethernet2.h"
3738
EthernetClient client;
38-
#warning Use Ethernet2 lib
39+
#warning Using Ethernet2 lib
3940
#elif USE_ETHERNET3
4041
#include "Ethernet3.h"
4142
EthernetClient client;
42-
#warning Use Ethernet3 lib
43+
#warning Using Ethernet3 lib
4344
#elif USE_ETHERNET_ESP8266
4445
#include "Ethernet_ESP8266.h"
4546
EthernetClient client;
46-
#warning Use Ethernet_ESP8266 lib
47+
#warning Using Ethernet_ESP8266 lib
4748
#elif USE_ETHERNET_LAN8742A
4849
#include <LwIP.h>
4950
#include <STM32Ethernet.h>
5051
EthernetClient client;
51-
#warning Use Ethernet_LAN8742A lib
52+
#warning Using Ethernet_LAN8742A lib
53+
54+
// KH, from v1.0.1
55+
#elif USE_UIP_ETHERNET
56+
#include <UIPEthernet.h>
57+
#include <utility/logging.h>
58+
EthernetClient client;
59+
#warning Using ENC28J60 UIPEthernet lib
60+
//////
61+
5262
#elif USE_CUSTOM_ETHERNET
5363
#include "Ethernet_XYZ.h"
5464
EthernetClient client;
55-
#warning Use Custom Ethernet library from EthernetWrapper. You must include a library here or error.
65+
#warning Using Custom Ethernet library from EthernetWrapper. You must include a library here or error.
5666
#else
5767
// Backup if none is selected
5868
#define USE_ETHERNET true
5969
#include "Ethernet.h"
6070
EthernetClient client;
61-
#warning Use Ethernet lib
71+
#warning Using Ethernet lib
6272
#endif
6373

6474
#include <MySQL_Generic_Connection.h>

src/MySQL_Generic_Packet.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
1414
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
1515
Licensed under MIT license
16-
Version: 1.0.0
16+
Version: 1.0.1
1717
1818
Version Modified By Date Comments
1919
------- ----------- ---------- -----------
2020
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
21-
WiFiNINA and ESP8266/ESP32-AT shields
21+
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
22+
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
2223
**********************************************************************************************************************************/
2324

2425
/*********************************************************************************************************************************
@@ -46,12 +47,17 @@
4647
#define MYSQL_EOF_PACKET 0xfe
4748
#define MYSQL_ERROR_PACKET 0xff
4849

49-
#define MYSQL_GENERIC_VERSION "1.0.0"
50+
#define MYSQL_GENERIC_VERSION "1.0.1"
5051

5152
class MySQL_Packet
5253
{
5354
public:
5455
byte *buffer; // buffer for reading packets
56+
57+
// KH, from v1.0.1
58+
uint16_t largest_buffer_size = 0;
59+
//////
60+
5561
int packet_len; // length of current packet
5662
Client *client; // instance of client class (e.g. EthernetClient)
5763
char *server_version; // save server version from handshake

0 commit comments

Comments
 (0)