File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #pragma once
2
+
3
+ #include " Arduino_ConnectionHandler.h"
4
+
5
+ namespace connectionHandler {
6
+ inline Client* getNewClient (NetworkAdapter net) {
7
+ switch (net) {
8
+ #ifdef BOARD_HAS_WIFI
9
+ case NetworkAdapter::WIFI:
10
+ return new WiFiClient ();
11
+ #endif // BOARD_HAS_WIFI
12
+ #ifdef BOARD_HAS_ETHERNET
13
+ case NetworkAdapter::ETHERNET:
14
+ return new EthernetClient ();
15
+ #endif // BOARD_HAS_ETHERNET
16
+ #ifdef BOARD_HAS_NB
17
+ case NetworkAdapter::NB:
18
+ return new NBClient ();
19
+ #endif // BOARD_HAS_NB
20
+ #ifdef BOARD_HAS_GSM
21
+ case NetworkAdapter::GSM:
22
+ return new GSMClient ();
23
+ #endif // BOARD_HAS_GSM
24
+ #ifdef BOARD_HAS_CATM1_NBIOT
25
+ case NetworkAdapter::CATM1:
26
+ return new GSMClient ();
27
+ #endif // BOARD_HAS_CATM1_NBIOT
28
+ default :
29
+ return nullptr ;
30
+ }
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments