Skip to content

Commit ee059d7

Browse files
fixup! defining a wrapper connection handler with the objective of being generic
1 parent ba35e68 commit ee059d7

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

src/GenericConnectionHandler.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,43 @@
2020
#include "Arduino_ConnectionHandler.h"
2121

2222
void GenericConnectionHandler::updateSetting(const models::NetworkSetting& s) {
23-
23+
// FIXME do not allocate a conn handler when update settings cannot work
2424
switch(s.type) {
25-
// #if defined(BOARD_HAS_WIFI)
26-
// case NetworkAdapter::WIFI:
27-
// _ch = new WiFiConnectionHandler();
28-
// break;
29-
// #endif
25+
#if defined(BOARD_HAS_WIFI)
26+
case NetworkAdapter::WIFI:
27+
_ch = new WiFiConnectionHandler();
28+
break;
29+
#endif
3030

3131
#if defined(BOARD_HAS_ETHERNET)
3232
case NetworkAdapter::ETHERNET:
3333
_ch = new EthernetConnectionHandler();
3434
break;
3535
#endif
3636

37-
// #if defined(BOARD_HAS_NB)
38-
// case NetworkAdapter::NB:
39-
// _ch = new NBConnectionHandler();
40-
// break;
41-
// #endif
37+
#if defined(BOARD_HAS_NB)
38+
case NetworkAdapter::NB:
39+
_ch = new NBConnectionHandler();
40+
break;
41+
#endif
4242

43-
// #if defined(BOARD_HAS_GSM)
44-
// case NetworkAdapter::GSM:
45-
// _ch = new GSMConnectionHandler();
46-
// break;
47-
// #endif
43+
#if defined(BOARD_HAS_GSM)
44+
case NetworkAdapter::GSM:
45+
_ch = new GSMConnectionHandler();
46+
break;
47+
#endif
4848

49-
// #if defined(BOARD_HAS_CATM1_NBIOT)
50-
// case NetworkAdapter::CATM1:
51-
// _ch = new CatM1ConnectionHandler();
52-
// break;
53-
// #endif
49+
#if defined(BOARD_HAS_CATM1_NBIOT)
50+
case NetworkAdapter::CATM1:
51+
_ch = new CatM1ConnectionHandler();
52+
break;
53+
#endif
5454

55-
// #if defined(BOARD_HAS_CELLULAR)
56-
// case NetworkAdapter::CELL:
57-
// _ch = new CellularConnectionHandler();
58-
// break;
59-
// #endif
55+
#if defined(BOARD_HAS_CELLULAR)
56+
case NetworkAdapter::CELL:
57+
_ch = new CellularConnectionHandler();
58+
break;
59+
#endif
6060

6161
// #if defined(BOARD_HAS_NOTECARD) // FIXME understand how to adapt it to the settings structure
6262
// case NOTECARD:

src/GenericConnectionHandler.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
a commercial license, send an email to [email protected].
1616
*/
1717

18-
#ifndef ARDUINO_WIFI_CONNECTION_HANDLER_H_
19-
#define ARDUINO_WIFI_CONNECTION_HANDLER_H_
18+
#ifndef ARDUINO_GENERIC_CONNECTION_HANDLER_H_
19+
#define ARDUINO_GENERIC_CONNECTION_HANDLER_H_
2020

2121
/******************************************************************************
2222
INCLUDE
@@ -57,4 +57,4 @@ class GenericConnectionHandler : public ConnectionHandler
5757
ConnectionHandler* _ch;
5858
};
5959

60-
#endif /* ARDUINO_WIFI_CONNECTION_HANDLER_H_ */
60+
#endif /* ARDUINO_GENERIC_CONNECTION_HANDLER_H_ */

0 commit comments

Comments
 (0)