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

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
khoih-prog authored Aug 19, 2020
1 parent 058cc62 commit 47f2d35
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 105 deletions.
5 changes: 3 additions & 2 deletions src/MySQL_Generic_Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

/*********************************************************************************************************************************
Expand Down
11 changes: 9 additions & 2 deletions src/MySQL_Generic_Connection_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

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

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

if (db)
MYSQL_LOGERROR1("Using Database:", db);

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

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

if (db)
MYSQL_LOGERROR1("Using Database:", db);

while (retries--)
{
if ( (now == 0) || ( millis() - now ) > CONNECT_DELAY_MS )
Expand Down
5 changes: 3 additions & 2 deletions src/MySQL_Generic_Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

/*********************************************************************************************************************************
Expand Down
5 changes: 3 additions & 2 deletions src/MySQL_Generic_Encrypt_Sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_H
Expand Down
5 changes: 3 additions & 2 deletions src/MySQL_Generic_Encrypt_Sha1_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

#ifndef MYSQL_GENERIC_ENCRYPT_SHA1_IMPL_H
Expand Down
30 changes: 20 additions & 10 deletions src/MySQL_Generic_Ethernet.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
(using Ethernet, EthernetLarge, Ethernet2, Ethernet3 library) and WiFiNINA
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

#ifndef MYSQL_GENERIC_ETHERNET_H
Expand All @@ -27,38 +28,47 @@
#if USE_ETHERNET
#include "Ethernet.h"
EthernetClient client;
#warning Use Ethernet lib
#warning Using Ethernet lib
#elif USE_ETHERNET_LARGE
#include "EthernetLarge.h"
EthernetClient client;
#warning Use EthernetLarge lib
#warning Using EthernetLarge lib
#elif USE_ETHERNET2
#include "Ethernet2.h"
EthernetClient client;
#warning Use Ethernet2 lib
#warning Using Ethernet2 lib
#elif USE_ETHERNET3
#include "Ethernet3.h"
EthernetClient client;
#warning Use Ethernet3 lib
#warning Using Ethernet3 lib
#elif USE_ETHERNET_ESP8266
#include "Ethernet_ESP8266.h"
EthernetClient client;
#warning Use Ethernet_ESP8266 lib
#warning Using Ethernet_ESP8266 lib
#elif USE_ETHERNET_LAN8742A
#include <LwIP.h>
#include <STM32Ethernet.h>
EthernetClient client;
#warning Use Ethernet_LAN8742A lib
#warning Using Ethernet_LAN8742A lib

// KH, from v1.0.1
#elif USE_UIP_ETHERNET
#include <UIPEthernet.h>
#include <utility/logging.h>
EthernetClient client;
#warning Using ENC28J60 UIPEthernet lib
//////

#elif USE_CUSTOM_ETHERNET
#include "Ethernet_XYZ.h"
EthernetClient client;
#warning Use Custom Ethernet library from EthernetWrapper. You must include a library here or error.
#warning Using Custom Ethernet library from EthernetWrapper. You must include a library here or error.
#else
// Backup if none is selected
#define USE_ETHERNET true
#include "Ethernet.h"
EthernetClient client;
#warning Use Ethernet lib
#warning Using Ethernet lib
#endif

#include <MySQL_Generic_Connection.h>
Expand Down
12 changes: 9 additions & 3 deletions src/MySQL_Generic_Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
Built by Khoi Hoang https://github.com/khoih-prog/MySQL_MariaDB_Generic
Licensed under MIT license
Version: 1.0.0
Version: 1.0.1
Version Modified By Date Comments
------- ----------- ---------- -----------
1.0.0 K Hoang 13/08/2020 Initial coding/porting to support nRF52, SAM DUE and SAMD21/SAMD51 boards using W5x00 Ethernet
WiFiNINA and ESP8266/ESP32-AT shields
(Ethernet, EthernetLarge, Ethernet2, Ethernet3 library), WiFiNINA and ESP8266/ESP32-AT shields
1.0.1 K Hoang 18/08/2020 Add support to Ethernet ENC28J60. Fix bug, optimize code.
**********************************************************************************************************************************/

/*********************************************************************************************************************************
Expand Down Expand Up @@ -46,12 +47,17 @@
#define MYSQL_EOF_PACKET 0xfe
#define MYSQL_ERROR_PACKET 0xff

#define MYSQL_GENERIC_VERSION "1.0.0"
#define MYSQL_GENERIC_VERSION "1.0.1"

class MySQL_Packet
{
public:
byte *buffer; // buffer for reading packets

// KH, from v1.0.1
uint16_t largest_buffer_size = 0;
//////

int packet_len; // length of current packet
Client *client; // instance of client class (e.g. EthernetClient)
char *server_version; // save server version from handshake
Expand Down
Loading

0 comments on commit 47f2d35

Please sign in to comment.