Skip to content

Commit

Permalink
Update SIM7670G method
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Dec 11, 2024
1 parent 9eaf5d0 commit 917fe00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/TinyGsmClientA76xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class TinyGsmA76xx : public TinyGsmModem<TinyGsmA76xx<modemType>>,
}

bool getNetworkActive() {
// return thisModem().getNetworkActiveImpl();
thisModem().sendAT(GF("+NETOPEN?"));
int res = thisModem().waitResponse(GF("+NETOPEN: 1"));
if (res == 1) { return true; }
Expand Down
13 changes: 10 additions & 3 deletions src/TinyGsmClientSIM7672.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class TinyGsmSim7672 : public TinyGsmModem<TinyGsmSim7672>,
return res;
}

bool enableNetwork(){
bool setNetworkActive(){
sendAT(GF("+NETOPEN"));
int res = waitResponse(GF("+NETOPEN: 0"),GF("+IP ERROR: Network is already opened"));
if (res != 1 && res != 2){
Expand All @@ -308,18 +308,25 @@ class TinyGsmSim7672 : public TinyGsmModem<TinyGsmSim7672>,
return true;
}

bool disableNetwork(){
bool setNetworkDeactivate(){
sendAT(GF("+NETCLOSE"));
if (waitResponse() != 1){
return false;
}
int res = waitResponse(GF("+NETCLOSE: 0"),GF("+NETCLOSE: 2"));
if (res != 1 || res != 2){
if (res != 1 && res != 2){
return false;
}
return true;
}

bool getNetworkActive() {
sendAT(GF("+NETOPEN?"));
int res = waitResponse(GF("+NETOPEN: 1"));
if (res == 1) { return true; }
return false;
}

/*
* Return code:
* -1 ping failed
Expand Down

0 comments on commit 917fe00

Please sign in to comment.