Browse Source

use CEREG first for BG96

I refered TinyGsmClientSaraR4.h for this patch.
dependabot/github_actions/actions/checkout-4
moto 4 years ago
parent
commit
ba778adb74
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/TinyGsmClientBG96.h

+ 10
- 1
src/TinyGsmClientBG96.h View File

@ -235,7 +235,16 @@ class TinyGsmBG96 : public TinyGsmModem<TinyGsmBG96>,
*/
public:
RegStatus getRegistrationStatus() {
return (RegStatus)getRegistrationStatusXREG("CREG");
// Check first for EPS registration
RegStatus epsStatus = (RegStatus)getRegistrationStatusXREG("CEREG");
// If we're connected on EPS, great!
if (epsStatus == REG_OK_HOME || epsStatus == REG_OK_ROAMING) {
return epsStatus;
} else {
// Otherwise, check generic network status
return (RegStatus)getRegistrationStatusXREG("CREG");
}
}
protected:


Loading…
Cancel
Save