-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: improved observing of disconnect for callbacks. #7341
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
Cellular: improved observing of disconnect for callbacks. #7341
Conversation
err = _at.set_urc_handler("+CGEV:", callback(this, &AT_CellularNetwork::urc_cgev)); | ||
if (err == NSAPI_ERROR_OK) { | ||
_at.lock(); | ||
_at.cmd_start("AT+CGEREP=2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea how well mode=2 is supported, for our needs mode=1 is good enough..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed mode to 1
void AT_CellularNetwork::urc_cgev() | ||
{ | ||
char buf[13]; | ||
if (_at.read_string(buf, 13) < 8 ) { // smallest string length we wan't to compare is 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo... space before )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -61,6 +61,7 @@ AT_CellularNetwork::~AT_CellularNetwork() | |||
} | |||
|
|||
_at.remove_urc_handler("NO CARRIER", callback(this, &AT_CellularNetwork::urc_no_carrier)); | |||
_at.remove_urc_handler("+CGEV:", callback(this, &AT_CellularNetwork::urc_cgev)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also be removed in disconnect()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
d3ae518
to
5ccfd9f
Compare
/morph build |
Build : SUCCESSBuild number : 2457 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2087 |
Test : SUCCESSBuild number : 2234 |
Description
Improved the way we notice when modem is disconnected so we can call callbacks for application and inform about disconnection.
@AriParkkila @mirelachirica please review.
Internal ref to defect: IOTCELL-1086
Pull request type