99unsigned long ArduinoCellular::getTime () {
1010 int year, month, day, hour, minute, second;
1111 float tz;
12- modem .getNetworkTime (&year, &month, &day, &hour, &minute, &second, &tz);
12+ Modem .getNetworkTime (&year, &month, &day, &hour, &minute, &second, &tz);
1313 return Time (year, month, day, hour, minute, second).getUNIXTimestamp ();
1414}
1515
@@ -21,7 +21,7 @@ ArduinoCellular::~ArduinoCellular() {
2121}
2222
2323void ArduinoCellular::begin () {
24- modem .init ();
24+ Modem .init ();
2525
2626 String modemInfo = this ->sendATCommand (" I" );
2727 if (modemInfo.indexOf (" EC200A" ) > 0 ){
@@ -33,15 +33,15 @@ void ArduinoCellular::begin() {
3333 }
3434
3535 // Set GSM module to text mode
36- modem .sendAT (" +CMGF=1" );
37- modem .waitResponse ();
36+ Modem .sendAT (" +CMGF=1" );
37+ Modem .waitResponse ();
3838
39- modem .sendAT (GF (" +CSCS=\" GSM\" " ));
40- modem .waitResponse ();
39+ Modem .sendAT (GF (" +CSCS=\" GSM\" " ));
40+ Modem .waitResponse ();
4141
4242 // Send intrerupt when SMS has been received
43- modem .sendAT (" +CNMI=2,1,0,0,0" );
44- modem .waitResponse ();
43+ Modem .sendAT (" +CNMI=2,1,0,0,0" );
44+ Modem .waitResponse ();
4545
4646#if defined(ARDUINO_CELLULAR_BEARSSL)
4747 ArduinoBearSSL.onGetTime (ArduinoCellular::getTime);
@@ -108,7 +108,7 @@ Geolocation ArduinoCellular::getGPSLocation(unsigned long timeout){
108108 unsigned long startTime = millis ();
109109
110110 while ((latitude == 0.00000 || longitude == 0.00000 ) && (millis () - startTime < timeout)) {
111- modem .getGPS (&latitude, &longitude);
111+ Modem .getGPS (&latitude, &longitude);
112112 delay (1000 );
113113 }
114114
@@ -127,7 +127,7 @@ Geolocation ArduinoCellular::getGPSLocation(unsigned long timeout){
127127
128128Time ArduinoCellular::getGPSTime (){
129129 int year, month, day, hour, minute, second;
130- modem .getGPSTime (&year, &month, &day, &hour, &minute, &second);
130+ Modem .getGPSTime (&year, &month, &day, &hour, &minute, &second);
131131 return Time (year, month, day, hour, minute, second);
132132}
133133
@@ -139,22 +139,22 @@ Time ArduinoCellular::getCellularTime(){
139139 int minute = 0 ;
140140 int second = 0 ;
141141 float tz;
142- if (modem .NTPServerSync () == 0 ) {
143- modem .getNetworkTime (&year, &month, &day, &hour, &minute, &second, &tz);
142+ if (Modem .NTPServerSync () == 0 ) {
143+ Modem .getNetworkTime (&year, &month, &day, &hour, &minute, &second, &tz);
144144 }
145145 return Time (year, month, day, hour, minute, second);
146146}
147147
148148
149149void ArduinoCellular::sendSMS (String number, String message){
150- modem .sendAT (" +CMGF=1" );
151- modem .waitResponse (1000 );
152- modem .sendAT (GF (" +CMGS=\" " ), number, GF (" \" " ));
153- if (modem .waitResponse (GF (" >" )) != 1 ) { }
154- modem .stream ->print (message); // Actually send the message
155- modem .stream ->write (static_cast <char >(0x1A )); // Terminate the message
156- modem .stream ->flush ();
157- auto response = modem .waitResponse (10000L );
150+ Modem .sendAT (" +CMGF=1" );
151+ Modem .waitResponse (1000 );
152+ Modem .sendAT (GF (" +CMGS=\" " ), number, GF (" \" " ));
153+ if (Modem .waitResponse (GF (" >" )) != 1 ) { }
154+ Modem .stream ->print (message); // Actually send the message
155+ Modem .stream ->write (static_cast <char >(0x1A )); // Terminate the message
156+ Modem .stream ->flush ();
157+ auto response = Modem .waitResponse (10000L );
158158
159159 if (this ->debugStream != nullptr ){
160160 this ->debugStream ->println (" Response: " + String (response));
@@ -163,24 +163,24 @@ void ArduinoCellular::sendSMS(String number, String message){
163163
164164
165165IPAddress ArduinoCellular::getIPAddress (){
166- return modem .localIP ();
166+ return Modem .localIP ();
167167}
168168
169169int ArduinoCellular::getSignalQuality (){
170- return modem .getSignalQuality ();
170+ return Modem .getSignalQuality ();
171171}
172172
173173TinyGsmClient ArduinoCellular::getNetworkClient (){
174- return ManagedTinyGsmClient (modem );
174+ return ManagedTinyGsmClient (Modem );
175175}
176176
177177HttpClient ArduinoCellular::getHTTPClient (const char * server, const int port){
178- return HttpClient (* new ManagedTinyGsmClient (modem ), server, port);
178+ return HttpClient (* new ManagedTinyGsmClient (Modem ), server, port);
179179}
180180
181181#if defined(ARDUINO_CELLULAR_BEARSSL)
182182HttpClient ArduinoCellular::getHTTPSClient (const char * server, const int port){
183- auto gsmClient = std::make_unique<ManagedTinyGsmClient>(modem );
183+ auto gsmClient = std::make_unique<ManagedTinyGsmClient>(Modem );
184184 auto sslClient = std::make_unique<BearSSLClient>(*gsmClient);
185185 auto & sslRef = *sslClient;
186186
@@ -190,7 +190,7 @@ HttpClient ArduinoCellular::getHTTPSClient(const char * server, const int port){
190190}
191191
192192BearSSLClient ArduinoCellular::getSecureNetworkClient (){
193- return BearSSLClient (* new ManagedTinyGsmClient (modem ));
193+ return BearSSLClient (* new ManagedTinyGsmClient (Modem ));
194194}
195195#endif
196196
@@ -209,14 +209,14 @@ size_t ArduinoCellular::getManagedClientCount() const {
209209}
210210
211211bool ArduinoCellular::isConnectedToOperator (){
212- return modem .isNetworkConnected ();
212+ return Modem .isNetworkConnected ();
213213}
214214
215215bool ArduinoCellular::connectToGPRS (const char * apn, const char * gprsUser, const char * gprsPass){
216216 if (this ->debugStream != nullptr ){
217217 this ->debugStream ->println (" Connecting to 4G network..." );
218218 }
219- while (!modem .gprsConnect (apn, gprsUser, gprsPass)) {
219+ while (!Modem .gprsConnect (apn, gprsUser, gprsPass)) {
220220 if (this ->debugStream != nullptr ){
221221 this ->debugStream ->print (" ." );
222222 }
@@ -226,11 +226,11 @@ bool ArduinoCellular::connectToGPRS(const char * apn, const char * gprsUser, con
226226}
227227
228228bool ArduinoCellular::isConnectedToInternet (){
229- return modem .isGprsConnected ();
229+ return Modem .isGprsConnected ();
230230}
231231
232232SimStatus ArduinoCellular::getSimStatus (){
233- int simStatus = modem .getSimStatus ();
233+ int simStatus = Modem .getSimStatus ();
234234 if (this ->debugStream != nullptr ){
235235 this ->debugStream ->println (" SIM Status: " + String (simStatus));
236236 }
@@ -249,12 +249,12 @@ SimStatus ArduinoCellular::getSimStatus(){
249249}
250250
251251bool ArduinoCellular::unlockSIM (String pin){
252- int simStatus = modem .getSimStatus ();
252+ int simStatus = Modem .getSimStatus ();
253253 if (simStatus == SIM_LOCKED) {
254254 if (this ->debugStream != nullptr ){
255255 this ->debugStream ->println (" Unlocking SIM..." );
256256 }
257- return modem .simUnlock (pin.c_str ());
257+ return Modem .simUnlock (pin.c_str ());
258258 }
259259 else if (simStatus == SIM_ERROR || simStatus == SIM_ANTITHEFT_LOCKED) {
260260 return false ;
@@ -267,7 +267,7 @@ bool ArduinoCellular::awaitNetworkRegistration(bool waitForever){
267267 if (this ->debugStream != nullptr ){
268268 this ->debugStream ->println (" Waiting for network registration..." );
269269 }
270- while (!modem .waitForNetwork (waitForNetworkTimeout)) {
270+ while (!Modem .waitForNetwork (waitForNetworkTimeout)) {
271271
272272 if (!waitForever) {
273273 return false ;
@@ -308,13 +308,13 @@ bool ArduinoCellular::enableGPS(bool assisted){
308308 return false ;
309309 }
310310
311- return modem .enableGPS ();
311+ return Modem .enableGPS ();
312312}
313313
314314String ArduinoCellular::sendATCommand (const char * command, unsigned long timeout){
315315 String response;
316- modem .sendAT (command);
317- modem .waitResponse (timeout, response);
316+ Modem .sendAT (command);
317+ Modem .waitResponse (timeout, response);
318318 return response;
319319}
320320
@@ -426,7 +426,7 @@ std::vector<SMS> parseSMSData(const String& data) {
426426}
427427
428428String ArduinoCellular::sendUSSDCommand (const char * command){
429- return modem .sendUSSD (command);
429+ return Modem .sendUSSD (command);
430430}
431431
432432std::vector<SMS> ArduinoCellular::getReadSMS (){
0 commit comments