Skip to content

Commit 44f439e

Browse files
committed
Accept string parameters
1 parent fb90af3 commit 44f439e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/ArdunioCellular.cpp renamed to src/ArduinoCellular.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ void ArduinoCellular::begin() {
4141

4242
}
4343

44-
bool ArduinoCellular::connect(const char * apn, const char * gprsUser, const char * gprsPass, const char * pin){
44+
bool ArduinoCellular::connect(String apn, String gprsUser, String gprsPass, String pin){
4545
SimStatus simStatus = getSimStatus();
4646
if(simStatus == SimStatus::SIM_LOCKED) {
47-
unlockSIM(pin);
47+
unlockSIM(pin.c_str());
4848
}
4949

5050
simStatus = getSimStatus();
5151
if(simStatus == SimStatus::SIM_READY) {
5252
if(awaitNetworkRegistration()){
53-
if(connectToGPRS(apn, gprsUser, gprsPass)){
53+
if(connectToGPRS(apn.c_str(), gprsUser.c_str(), gprsPass.c_str())){
5454
Serial.println("Setting DNS...");
5555
Serial.println(this->sendATCommand("+QIDNSCFG=1,\"8.8.8.8\",\"8.8.4.4\""));
5656
return true;

Diff for: src/ArduinoCellular.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class ArduinoCellular {
9898
* @param pin The SIM card PIN.
9999
* @return True if the connection is successful, false otherwise.
100100
*/
101-
bool connect(const char * apn, const char * gprsUser, const char * gprsPass, const char * pin);
101+
bool connect(String apn, String gprsUser, String gprsPass, String pin);
102102

103103
/**
104104
* @brief Checks if the modem is registered on the network.

0 commit comments

Comments
 (0)