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()
5454 PROTECTED MEMBER FUNCTIONS
5555 ******************************************************************************/
5656
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+
5784NetworkConnectionState CellularConnectionHandler::update_handleInit ()
5885{
86+ #if defined(ARDUINO_OPTA) && defined(BOARD_HAS_CELLULAR)
87+ beginOptaCellular ();
88+ #else
5989 _cellular.begin ();
90+ #endif
6091 _cellular.setDebugStream (Serial);
6192 if (strlen (_settings.cell .pin ) > 0 && !_cellular.unlockSIM (_settings.cell .pin )) {
6293 DEBUG_ERROR (F (" SIM not present or wrong PIN" ));
Original file line number Diff line number Diff line change 7474#if defined(ARDUINO_OPTA)
7575 #define BOARD_HAS_WIFI
7676 #define BOARD_HAS_ETHERNET
77+ #define BOARD_HAS_CELLULAR
7778 #define NETWORK_HARDWARE_ERROR WL_NO_SHIELD
7879 #define NETWORK_IDLE_STATUS WL_IDLE_STATUS
7980 #define NETWORK_CONNECTED WL_CONNECTED
You can’t perform that action at this time.
0 commit comments