Skip to content

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

Merged

Conversation

jarvte
Copy link
Contributor

@jarvte 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");

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..?

Copy link
Contributor Author

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

Choose a reason for hiding this comment

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

typo... space before )

Copy link
Contributor Author

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@jarvte jarvte force-pushed the packet_domain_urc_for_disconnect_callback branch from d3ae518 to 5ccfd9f Compare June 27, 2018 06:34
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 27, 2018

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented Jun 27, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 27, 2018

@cmonr cmonr merged commit 719d8e0 into ARMmbed:master Jun 27, 2018
@jarvte jarvte deleted the packet_domain_urc_for_disconnect_callback branch June 28, 2018 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants