@@ -133,7 +133,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleInit() {
133133 Debug.print (DBG_VERBOSE, " ::INIT" );
134134 if (!modem.begin (band)) {
135135 Debug.print (DBG_VERBOSE, " Failed to start module" );
136- execNetworkEventCallback (_on_error_event_callback , 0 );
136+ execCallback (NetworkConnectionEvent::ERROR , 0 );
137137 Debug.print (DBG_ERROR, " Something went wrong; are you indoor? Move near a window, then reset and retry." );
138138 };
139139 // A delay is required between modem.begin(band) and modem.joinOTAA(appeui, appkey) in order to let the chip to be correctly initialized before the connection attempt
@@ -149,14 +149,14 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnecting() {
149149 Debug.print (DBG_VERBOSE, " ::CONNECTING" );
150150 bool networkStatus = modem.joinOTAA (appeui, appkey);
151151 if (networkStatus != true ) {
152- execNetworkEventCallback (_on_error_event_callback , 0 );
152+ execCallback (NetworkConnectionEvent::ERROR , 0 );
153153 Debug.print (DBG_ERROR, " Something went wrong; are you indoor? Move near a window, then reset and retry." );
154154 return NetworkConnectionState::ERROR;
155155 }
156156
157157 Debug.print (DBG_INFO, " Connected to the network" );
158158 connectionTickTimeInterval = CHECK_INTERVAL_CONNECTED;
159- execNetworkEventCallback (_on_connect_event_callback , 0 );
159+ execCallback (NetworkConnectionEvent::CONNECTED , 0 );
160160 return NetworkConnectionState::CONNECTED;
161161}
162162
@@ -165,7 +165,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnected() {
165165 bool networkStatus = modem.connected ();
166166 Debug.print (DBG_VERBOSE, " Connection state: %d" , networkStatus);
167167 if (networkStatus != true ) {
168- execNetworkEventCallback (_on_disconnect_event_callback , 0 );
168+ execCallback (NetworkConnectionEvent::DISCONNECTED , 0 );
169169
170170 Debug.print (DBG_ERROR, " Connection to the network lost." );
171171 if (keepAlive) {
@@ -180,7 +180,7 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnected() {
180180}
181181
182182NetworkConnectionState LoRaConnectionHandler::update_handleDisconnecting () {
183- execNetworkEventCallback (_on_disconnect_event_callback , 0 );
183+ execCallback (NetworkConnectionEvent::DISCONNECTED , 0 );
184184
185185 Debug.print (DBG_ERROR, " Connection to the network lost." );
186186 if (keepAlive) {
0 commit comments