Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process 'CEREG: 0' URCs on R410M #2119

Merged
merged 1 commit into from
Jun 7, 2020

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Jun 1, 2020

Problem

A registration URC like CEREG: 0 is not processed by Electron LTEs, and hence even though a CEREG: 0 is received by the device, the device still blinks cyan assuming it's connected to cloud, and does not attempt a disconnection process.

Solution

Read and process reg URCs for CxREG :0 to notify a disconnection

Steps to Test

Example App

After a successful cloud connection, remove antenna or trigger (somehow) a loss of registration, by which you will see a CEREG: 0 on the module. When this happens, notice that the device should go back to blinking green, signaling a new connection attempt.

void setup() {
}

void loop() {
}

References

ch36648


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@keeramis keeramis force-pushed the ch36648/process_reg_urcs_for_detach branch from 23e68b9 to a279b4a Compare June 1, 2020 07:07
@keeramis keeramis requested review from avtolstoy and technobly and removed request for avtolstoy June 1, 2020 07:16
@keeramis keeramis changed the title Detect 'CxREG: 0' URCs on R410M Process 'CxREG: 0' URCs on R410M Jun 1, 2020
@keeramis keeramis force-pushed the ch36648/process_reg_urcs_for_detach branch from d80bd77 to dc5b5c2 Compare June 1, 2020 07:38
@keeramis keeramis changed the title Process 'CxREG: 0' URCs on R410M Process 'CEREG: 0' URCs on R410M Jun 3, 2020
@avtolstoy avtolstoy added this to the 2.0.0 milestone Jun 4, 2020
@@ -1606,7 +1613,7 @@ bool MDMParser::getCellularGlobalIdentity(CellularGlobalIdentity& cgi_) {
}

void MDMParser::_setBandSelectString(MDM_BandSelect &data, char* bands, int index /*= 0*/) {
char band[5];
char band[6];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this band change shouldn't be in this PR?

_attached = false;
HAL_NET_notify_disconnected();
}
}
Copy link
Member

@technobly technobly Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: spelling on "Registration"

Should && *reg == REG_NONE be && (*reg != REG_HOME) && (*reg != REG_ROAMING) since that's what we define as REG_OK() .... or simply !REG_OK(*reg)

_attached_urc = (*reg == REG_NONE) ? 0:1; would also not need to be tested, just set to 0, and also then no need to test for if (!_attached_urc).

Perhaps also put the && !strcmp(s, "CEREG:") last, as it will chew up more cycles.

We can also test && reg == &_net.eps instead of strcmp() again?

@keeramis keeramis force-pushed the ch36648/process_reg_urcs_for_detach branch 2 times, most recently from 27fa19d to 73d305c Compare June 4, 2020 21:36
@keeramis keeramis requested a review from technobly June 4, 2020 22:12
@keeramis keeramis force-pushed the ch36648/process_reg_urcs_for_detach branch 3 times, most recently from abe8cc8 to 7e949e1 Compare June 5, 2020 16:53
@keeramis keeramis force-pushed the ch36648/process_reg_urcs_for_detach branch from f2fa171 to fdd7d9c Compare June 6, 2020 15:56
@keeramis keeramis merged commit 3a5cc21 into develop Jun 7, 2020
@keeramis keeramis deleted the ch36648/process_reg_urcs_for_detach branch June 7, 2020 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants