Skip to content

Commit c53bdfa

Browse files
removed apns and other data
1 parent fc2fbdc commit c53bdfa

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

examples/HTTPClient/arduino_secrets.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define SECRET_PINNUMBER "" // replace with your SIM card PIN
22
#define SECRET_GPRS_APN "apn" // replace with your GPRS APN
33
#define SECRET_GPRS_LOGIN "login" // replace with your GPRS login
4-
#define SECRET_GPRS_PASSWORD "password" // replace with your GPRS password
4+
#define SECRET_GPRS_PASSWORD "password" // replace with your GPRS password

examples/ReceiveSMS/arduino_secrets.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#define SECRET_PINNUMBER "" // replace with your SIM card PIN
22
#define SECRET_GPRS_APN "apn" // replace with your GPRS APN
33
#define SECRET_GPRS_LOGIN "login" // replace with your GPRS login
4-
#define SECRET_GPRS_PASSWORD "password" // replace with your GPRS password
4+
#define SECRET_GPRS_PASSWORD "password" // replace with your GPRS password
5+
6+
7+
#define SECRET_PINNUMBER "1234" // replace with your SIM card PIN
8+
#define SECRET_GPRS_APN "live.vodafone.com" // replace with your GPRS APN
9+
#define SECRET_GPRS_LOGIN "live" // replace with your GPRS login
10+
#define SECRET_GPRS_PASSWORD "" // replace with your GPRS password

examples/SendSMS/SendSMS.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ void setup(){
3333
cellular.connect(apn, gprsUser, gprsPass, pinCode);
3434

3535
Serial.println("Sending SMS...");
36-
cellular.sendSMS("+41791234567", "bleep bleep");
36+
cellular.sendSMS("<INSERT_NUMBER_HERE>", "bleep bleep");
3737
Serial.println("Done.");
3838
}
3939

src/ArduinoCellular.cpp

+3-25
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ void ArduinoCellular::begin() {
4343

4444
}
4545

46-
bool ArduinoCellular::connect(const char * apn, const char * gprsUser, const char * gprsPass, const char * pin){
46+
bool ArduinoCellular::connect(String apn, String gprsUser, String gprsPass, String pin){
4747
SimStatus simStatus = getSimStatus();
4848
if(simStatus == SimStatus::SIM_LOCKED) {
49-
unlockSIM(pin);
49+
unlockSIM(pin.c_str());
5050
}
5151

5252
simStatus = getSimStatus();
5353
if(simStatus == SimStatus::SIM_READY) {
5454
if(awaitNetworkRegistration()){
55-
if(connectToGPRS(apn, gprsUser, gprsPass)){
55+
if(connectToGPRS(apn.c_str(), gprsUser.c_str(), gprsPass.c_str())){
5656
Serial.println("Setting DNS...");
5757
Serial.println(this->sendATCommand("+QIDNSCFG=1,\"8.8.8.8\",\"8.8.4.4\""));
5858
return true;
@@ -305,25 +305,3 @@ std::vector<SMS> ArduinoCellular::getUnreadSMS(){
305305
}
306306

307307

308-
309-
bool ArduinoCellular::connect(String apn, String gprsUser, String gprsPass, String pin){
310-
SimStatus simStatus = getSimStatus();
311-
if(simStatus == SimStatus::SIM_LOCKED) {
312-
unlockSIM(pin.c_str());
313-
}
314-
315-
simStatus = getSimStatus();
316-
if(simStatus == SimStatus::SIM_READY) {
317-
if(awaitNetworkRegistration()){
318-
if(connectToGPRS(apn.c_str(), gprsUser.c_str(), gprsPass.c_str())){
319-
Serial.println("Setting DNS...");
320-
Serial.println(this->sendATCommand("+QIDNSCFG=1,\"8.8.8.8\",\"8.8.4.4\""));
321-
return true;
322-
}
323-
} else {
324-
return false;
325-
}
326-
} else {
327-
return false;
328-
}
329-
}

0 commit comments

Comments
 (0)