Skip to content

Commit e6b7ba2

Browse files
committed
Remove pin parameter from connect function
1 parent 37c9ce3 commit e6b7ba2

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/ArduinoCellular.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,20 @@ void ArduinoCellular::begin() {
4343

4444
}
4545

46-
bool ArduinoCellular::connect(String apn, String username, String password, String pin){
46+
bool ArduinoCellular::connect(String apn, String username, String password){
4747
SimStatus simStatus = getSimStatus();
48-
if(simStatus == SimStatus::SIM_LOCKED && pin.length() > 0){
49-
unlockSIM(pin.c_str());
48+
49+
if(simStatus == SimStatus::SIM_LOCKED){
50+
if(this->debugStream != nullptr){
51+
this->debugStream->println("SIM locked, cannot connect to network.");
52+
}
53+
54+
return false;
5055
}
5156

52-
simStatus = getSimStatus();
5357
if(simStatus != SimStatus::SIM_READY) {
5458
if(this->debugStream != nullptr){
55-
this->debugStream->println("SIM not ready or incorrect PIN provided.");
59+
this->debugStream->println("SIM not ready, cannot connect to network.");
5660
}
5761
return false;
5862
}

src/ArduinoCellular.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ class ArduinoCellular {
107107
* @param apn The Access Point Name.
108108
* @param username The APN username.
109109
* @param password The APN password.
110-
* @param pin The SIM card PIN.
111110
* @return True if the connection is successful, false otherwise.
112111
*/
113-
bool connect(String apn = "", String username = "", String password = "", String pin = "");
112+
bool connect(String apn = "", String username = "", String password = "");
114113

115114
/**
116115
* @brief Checks if the modem is registered on the network.

0 commit comments

Comments
 (0)