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

Merged
merged 1 commit into from Jun 27, 2018

Conversation

Projects
None yet
5 participants
@jarvte
Contributor

jarvte commented Jun 27, 2018

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

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change
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");

This comment has been minimized.

@AriParkkila

AriParkkila Jun 27, 2018

Contributor

Any idea how well mode=2 is supported, for our needs mode=1 is good enough..?

This comment has been minimized.

@jarvte

jarvte Jun 27, 2018

Contributor

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

This comment has been minimized.

@AriParkkila

AriParkkila Jun 27, 2018

Contributor

typo... space before )

This comment has been minimized.

@jarvte

jarvte Jun 27, 2018

Contributor

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));

This comment has been minimized.

@AriParkkila

AriParkkila Jun 27, 2018

Contributor

Should also be removed in disconnect()

This comment has been minimized.

@jarvte

jarvte Jun 27, 2018

Contributor

done

@jarvte jarvte force-pushed the jarvte:packet_domain_urc_for_disconnect_callback branch from d3ae518 to 5ccfd9f Jun 27, 2018

@0xc0170 0xc0170 added the needs: CI label Jun 27, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 27, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jun 27, 2018

Build : SUCCESS

Build number : 2457
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7341/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit 719d8e0 into ARMmbed:master Jun 27, 2018

14 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 929 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 10162 cycles (+177 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@jarvte jarvte deleted the jarvte:packet_domain_urc_for_disconnect_callback branch Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment