Skip to content

Commit 0f92717

Browse files
committed
Removing not required classes TcpIpConnectionHandler ans LPWANConnectionHandler
1 parent e6545fe commit 0f92717

7 files changed

+22
-128
lines changed

src/Arduino_ConnectionHandler.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class ConnectionHandler {
148148
virtual NetworkConnectionState getStatus() __attribute__((deprecated)) {
149149
return netConnectionState;
150150
}
151-
virtual void connect();
152-
virtual void disconnect();
151+
virtual void connect() = 0;
152+
virtual void disconnect() = 0;
153153
void addCallback(NetworkConnectionEvent const event, OnNetworkEventCallback callback);
154154
void addConnectCallback(OnNetworkEventCallback callback);
155155
void addDisconnectCallback(OnNetworkEventCallback callback);
@@ -167,12 +167,14 @@ class ConnectionHandler {
167167

168168
};
169169

170-
#if defined(BOARD_HAS_WIFI) || defined(BOARD_HAS_GSM) || defined(BOARD_HAS_NB)
171-
#include "Arduino_TcpIpConnectionHandler.h"
172-
#endif
173-
174-
#if defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310)
175-
#include "Arduino_LPWANConnectionHandler.h"
170+
#if defined(BOARD_HAS_WIFI)
171+
#include "Arduino_WiFiConnectionHandler.h"
172+
#elif defined(BOARD_HAS_GSM)
173+
#include "Arduino_GSMConnectionHandler.h"
174+
#elif defined(BOARD_HAS_NB)
175+
#include "Arduino_NBConnectionHandler.h"
176+
#elif defined(BOARD_HAS_LORA)
177+
#include "Arduino_LoRaConnectionHandler.h"
176178
#endif
177179

178180
#endif /* CONNECTION_HANDLER_H_ */

src/Arduino_GSMConnectionHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
INCLUDE
2323
******************************************************************************/
2424

25-
#include "Arduino_TcpIpConnectionHandler.h"
25+
#include "Arduino_ConnectionHandler.h"
2626

2727

2828
#ifdef BOARD_HAS_GSM /* Only compile if this is a board with GSM */
@@ -31,7 +31,7 @@
3131
CLASS DECLARATION
3232
******************************************************************************/
3333

34-
class GSMConnectionHandler : public TcpIpConnectionHandler {
34+
class GSMConnectionHandler : public ConnectionHandler {
3535
public:
3636
GSMConnectionHandler(const char *pin, const char *apn, const char *login, const char *pass, const bool keepAlive = true);
3737

src/Arduino_LPWANConnectionHandler.h

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/Arduino_LoRaConnectionHandler.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
INCLUDE
2323
******************************************************************************/
2424

25-
#include "Arduino_LPWANConnectionHandler.h"
25+
#include "Arduino_ConnectionHandler.h"
2626

2727
typedef enum {
2828
LORA_ERROR_ACK_NOT_RECEIVED = -1,
@@ -40,20 +40,20 @@ typedef enum {
4040
CLASS DECLARATION
4141
******************************************************************************/
4242

43-
class LoRaConnectionHandler : public LPWANConnectionHandler {
43+
class LoRaConnectionHandler : public ConnectionHandler {
4444
public:
4545
LoRaConnectionHandler(const char *_appeui, const char *_appkey, _lora_band = _lora_band::EU868, _lora_class = _lora_class::CLASS_A);
4646

47-
void init();
48-
unsigned long getTime();
49-
NetworkConnectionState check();
47+
virtual void init();
48+
virtual unsigned long getTime();
49+
virtual NetworkConnectionState check();
5050

5151
int write(const uint8_t *buf, size_t size);
5252
int read();
5353
bool available();
5454

55-
void disconnect();
56-
void connect();
55+
virtual void disconnect();
56+
virtual void connect();
5757

5858
private:
5959

src/Arduino_NBConnectionHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
CLASS DECLARATION
3131
******************************************************************************/
3232

33-
class NBConnectionHandler : public TcpIpConnectionHandler {
33+
class NBConnectionHandler : public ConnectionHandler {
3434
public:
3535
NBConnectionHandler(const char *pin, const bool keepAlive = true);
3636
NBConnectionHandler(const char *pin, const char *apn, const bool keepAlive = true);

src/Arduino_TcpIpConnectionHandler.h

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/Arduino_WiFiConnectionHandler.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
INCLUDE
2323
******************************************************************************/
2424

25-
#include "Arduino_TcpIpConnectionHandler.h"
25+
#include "Arduino_ConnectionHandler.h"
2626

2727
#ifdef BOARD_HAS_WIFI /* Only compile if the board has WiFi */
2828

2929
/******************************************************************************
3030
CLASS DECLARATION
3131
******************************************************************************/
3232

33-
class WiFiConnectionHandler : public TcpIpConnectionHandler {
33+
class WiFiConnectionHandler : public ConnectionHandler {
3434
public:
3535
WiFiConnectionHandler(const char *_ssid, const char *_pass, bool _keepAlive = true);
3636

0 commit comments

Comments
 (0)