File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,40 @@ UDP & CellularConnectionHandler::getUDP()
54
54
PROTECTED MEMBER FUNCTIONS
55
55
******************************************************************************/
56
56
57
+ #if defined(ARDUINO_OPTA) && defined(BOARD_HAS_CELLULAR)
58
+ CellularExpansion ce;
59
+ static void beginOptaCellular () {
60
+ static bool first_call = true ;
61
+
62
+ if (first_call) {
63
+ first_call = false ;
64
+ OptaController.registerCustomExpansion (CellularExpansion::getProduct (),
65
+ CellularExpansion::makeExpansion,
66
+ CellularExpansion::startUp);
67
+ OptaController.begin ();
68
+ delay (500 );
69
+ for (int i = 0 ; i < OptaController.getExpansionNum (); i++) {
70
+ ce = OptaController.getExpansion (i);
71
+ if (ce) {
72
+ ce.ctrlModem (true );
73
+ delay (100 );
74
+ break ;
75
+ }
76
+ }
77
+ }
78
+ else {
79
+ OptaController.update ();
80
+ }
81
+ }
82
+ #endif
83
+
57
84
NetworkConnectionState CellularConnectionHandler::update_handleInit ()
58
85
{
86
+ #if defined(ARDUINO_OPTA) && defined(BOARD_HAS_CELLULAR)
87
+ beginOptaCellular ();
88
+ #else
59
89
_cellular.begin ();
90
+ #endif
60
91
_cellular.setDebugStream (Serial);
61
92
if (strlen (_settings.cell .pin ) > 0 && !_cellular.unlockSIM (_settings.cell .pin )) {
62
93
DEBUG_ERROR (F (" SIM not present or wrong PIN" ));
Original file line number Diff line number Diff line change 74
74
#if defined(ARDUINO_OPTA)
75
75
#define BOARD_HAS_WIFI
76
76
#define BOARD_HAS_ETHERNET
77
+ #define BOARD_HAS_CELLULAR
77
78
#define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
78
79
#define NETWORK_IDLE_STATUS WL_IDLE_STATUS
79
80
#define NETWORK_CONNECTED WL_CONNECTED
You can’t perform that action at this time.
0 commit comments