-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conversation
@AriParkkila, thank you for your changes. |
@@ -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) { |
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.
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.
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.
So far, I have seen only NONIP
and Non-IP
strings and this is an easy way to add support without breaking existing APIs.
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.
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?
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.
Wouldn't that break string_to_pdp_type
API?
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.
That's ok for mbed-os 6.
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.
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"); |
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.
Maybe tr_error
is better here or maybe even an assert.
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.
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 please review |
@AriParkkila There are conflicts now with master |
a7f68d2
to
addbd8c
Compare
@0xc0170 It's now rebased. |
@AriParkkila it unfortunately looks like a further rebase is required |
addbd8c
to
4300582
Compare
@adbridge It's rebased now. |
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
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.
Some very minor comments, but not enough to block the approval
signals.set(SIGNAL_SIGIO_RX | SIGNAL_SIGIO_TX); | ||
} | ||
|
||
void NIDDSOCKET_ECHOTEST_NONBLOCK() |
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.
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))) { |
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.
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() |
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.
Camelcase function name ? Strictly we shouldn't have those but it seems there are similar ones already so consistency is more important..
@AriParkkila looks like there is a failure in the compilation of the Unittests... |
Add a missing license header. Remove semaphores and add +CRTDCP to support async operation. Fix delete context and disconnect to execute just once. Add support for NONIP PPD type. Change CellularNetwork::clear() to virtual so it can be overridden.
4212817
to
558b322
Compare
@0xc0170 It's now rebased, and should be ready for merge. |
@AriParkkila Thanks, can you address also one astyle failure (might be due to the rebase) ? we will restart CI |
558b322
to
7899fea
Compare
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@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. |
@adbridge I don't think this PR has API changes. Can you elaborate please? |
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:
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
The provided test cases pass with
mbed test -n tests-netsocket-nidd --app-config=tools/test_configs/NIDDInterface.json
on: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.Reviewers