Skip to content

Non-IP socket implementation for NIDD over CP #12065

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
merged 11 commits into from
Jan 7, 2020

Conversation

AriParkkila
Copy link

Summary of changes

Change cellular Non-IP socket implementation for NIDD over CP to be asynchronous and to conform better to 3GPP TS 27.007:

  • Add NIDD over CP socket tests
  • Add NIDD for U-blox/N2XX
  • Add NIDD for Quectel/BC95
  • Change CellularNonIPSocket to poll before timeout
  • Change ATHandler debug print levels
  • Change 3GPP TS 27.007 NIDD to async
  • Add count/dequeue methods in CellularList
  • Change CellularNonIPSocket to singleton
  • Fix Non-IP of Quectel/BG96 modem driver

Impact of changes

Migration actions required

Documentation


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

The provided test cases pass with mbed test -n tests-netsocket-nidd --app-config=tools/test_configs/NIDDInterface.json on:

  • MTB_ADV_WISE_1570-GCC_ARM
  • NRF52840_DK-GCC_ARM with "QUECTEL_BG96.provide-default": true
  • MTB_STM_L475-GCC_ARM with "UBLOX_N2XX.provide-default": true

For mbed-os-cellular-example define "sock-type": "NONIP" and "cellular.control-plane-opt": true, and also "cellular.clear-on-connect": true may be required to prevent the default IP context.

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Reviewers


@ciarmcom ciarmcom requested review from a team December 10, 2019 12:00
@ciarmcom
Copy link
Member

@AriParkkila, thank you for your changes.
@ARMmbed/mbed-os-test @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

@AriParkkila AriParkkila changed the title Cell fea nidd Non-IP socket implementation for NIDD over CP Dec 10, 2019
@@ -378,6 +378,8 @@ pdp_type_t string_to_pdp_type(const char *pdp_type_str)
pdp_type = IPV4_PDP_TYPE;
} else if (len == 6 && memcmp(pdp_type_str, "Non-IP", len) == 0) {
pdp_type = NON_IP_PDP_TYPE;
} else if (len == 5 && memcmp(pdp_type_str, "NONIP", len) == 0) {
Copy link
Contributor

@kivaisan kivaisan Dec 11, 2019

Choose a reason for hiding this comment

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

Is this now a bit problematic if modem has a non-standard string for Non-IP? I think this should be tied to get_nonip_context_type_str() method somehow.

Copy link
Author

Choose a reason for hiding this comment

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

So far, I have seen only NONIP and Non-IP strings and this is an easy way to add support without breaking existing APIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about giving get_nonip_context_type_str() as a function pointer parameter to string_to_pdp_type() . Then as a last step it would check match from that?

Copy link
Author

Choose a reason for hiding this comment

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

Wouldn't that break string_to_pdp_type API?

Copy link
Contributor

Choose a reason for hiding this comment

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

That's ok for mbed-os 6.

Copy link
Contributor

Choose a reason for hiding this comment

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

string_to_pdp_type() is only used in cellular context classes so maybe it should be moved to CellularContext in mbed-os 6. Then it can directly call get_nonip_context_type_str().

@@ -69,6 +69,10 @@ CellularContext::CellularContext() : _next(0), _stack(0), _pdp_type(DEFAULT_PDP_

void CellularContext::cp_data_received()
{
if (!_cp_netif) {
tr_warn("Cellular Non-IP callback missing");
Copy link
Contributor

@kivaisan kivaisan Dec 11, 2019

Choose a reason for hiding this comment

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

Maybe tr_error is better here or maybe even an assert.

Copy link
Author

Choose a reason for hiding this comment

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

It's actually fine (but not desirable) to receive callback before _cp_netif is created. E.g. QUECTEL_BG96_CellularContext::urc_nidd is subscribed already at its constructor, but _cp_netif create is deferred until CellularNonIPSocket::open so the modem may be sending events to a previous NIDD context.

@AnttiKauppila AnttiKauppila added the release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0 label Dec 11, 2019
@bulislaw
Copy link
Member

@AnttiKauppila please review

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 11, 2019

@AriParkkila There are conflicts now with master

@AriParkkila
Copy link
Author

@0xc0170 It's now rebased.

@adbridge
Copy link
Contributor

@AriParkkila it unfortunately looks like a further rebase is required

@AriParkkila
Copy link
Author

@adbridge It's rebased now.

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 23, 2019

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

Copy link
Contributor

@adbridge adbridge left a comment

Choose a reason for hiding this comment

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

Some very minor comments, but not enough to block the approval

signals.set(SIGNAL_SIGIO_RX | SIGNAL_SIGIO_TX);
}

void NIDDSOCKET_ECHOTEST_NONBLOCK()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you have some function names all in capitals? This doesn't conform to the coding guidelines ...

@@ -682,7 +686,7 @@ nsapi_error_t AT_CellularNetwork::clear()
}
context = context->next;
}
#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN
#if defined(MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN) && !MBED_CONF_CELLULAR_CONTROL_PLANE_OPT
char pdp_type_str[sizeof("IPV4V6")];
if (_device.get_property(AT_CellularDevice::PROPERTY_IPV4V6_PDP_TYPE) ||
(_device.get_property(AT_CellularDevice::PROPERTY_IPV4_PDP_TYPE) && _device.get_property(AT_CellularDevice::PROPERTY_IPV6_PDP_TYPE))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Has the indentation gone a little astray here ?

@@ -38,3 +38,26 @@ nsapi_error_t QUECTEL_BC95_CellularNetwork::set_access_technology_impl(RadioAcce

return NSAPI_ERROR_OK;
}

nsapi_error_t QUECTEL_BC95_CellularNetwork::clear()
Copy link
Contributor

Choose a reason for hiding this comment

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

Camelcase function name ? Strictly we shouldn't have those but it seems there are similar ones already so consistency is more important..

@adbridge
Copy link
Contributor

@AriParkkila looks like there is a failure in the compilation of the Unittests...

@AriParkkila
Copy link
Author

@0xc0170 It's now rebased, and should be ready for merge.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2020

@AriParkkila Thanks, can you address also one astyle failure (might be due to the rebase) ? we will restart CI

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 7, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 7, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@adbridge
Copy link
Contributor

@bulislaw @0xc0170 This is changing an API so looks like it should be breaking change to me?

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 17, 2020

@ARMmbed/mbed-os-wan We are reviewing 6.0.0 PRs and their release notes. Please review above ^^

My take here this is not breaking. Is this just a patch as set above ? In case not, please add Release notes.

@AriParkkila
Copy link
Author

@adbridge I don't think this PR has API changes. Can you elaborate please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-1 First pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants