Skip to content
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

Refactor unnecessary functions from cellular driver #12265

Merged
merged 3 commits into from Jan 17, 2020

Conversation

AriParkkila
Copy link

Summary of changes

Remove unnecessary internal (get_send_delay, is_protocol_supported and get_max_socket_count) functions from cellular modem drivers, and add them as simple constant properties.

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

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

Reviewers


@ciarmcom ciarmcom requested review from a team January 16, 2020 08:00
@ciarmcom
Copy link
Member

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

return NSAPI_ERROR_UNSUPPORTED;
}

int max_socket_count = get_max_socket_count();
if (proto == NSAPI_UDP) {
if (!_device.get_property(AT_CellularDevice::PROPERTY_IP_UDP)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Cosmetic, but maybe these could be combined into one if -sentence, like:
if (proto == NSAPI_UDP && !_device.get_property(AT_CellularDevice::PROPERTY_IP_UDP)) {

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Jan 16, 2020
@0xc0170 0xc0170 requested a review from a team January 16, 2020 08:41
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 16, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 16, 2020

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@@ -39,6 +39,10 @@ static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = {
0, // PROPERTY_NON_IP_PDP_TYPE
1, // PROPERTY_AT_CGEREP
1, // PROPERTY_AT_COPS_FALLBACK_AUTO
0, // PROPERTY_SOCKET_COUNT
Copy link
Contributor

Choose a reason for hiding this comment

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

Here for this target PROPERTY_SOCKET_COUNT is 7, PROPERTY_IP_TCP and PROPERTY_IP_UDP is 1.

Copy link
Author

Choose a reason for hiding this comment

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

The definitions here are for the modem's onboard IP stack. Since this driver has no UBLOX_PPP_CellularStack.cpp, it should be used only with LWIP that has own definitions.

@@ -62,6 +66,10 @@ static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = {
0, // PROPERTY_NON_IP_PDP_TYPE
1, // PROPERTY_AT_CGEREP
1, // PROPERTY_AT_COPS_FALLBACK_AUTO
0, // PROPERTY_SOCKET_COUNT
Copy link
Contributor

Choose a reason for hiding this comment

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

Same like mentioned above , PROPERTY_SOCKET_COUNT is 7, PROPERTY_IP_TCP and PROPERTY_IP_UDP is 1.

Copy link
Author

Choose a reason for hiding this comment

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

Please see my comment above.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 17, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jan 17, 2020

Test run: SUCCESS

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

@0xc0170 0xc0170 removed the needs: CI label Jan 17, 2020
@0xc0170 0xc0170 merged commit ecf4d62 into ARMmbed:master Jan 17, 2020
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-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants