Skip to content

Cellular: Removed boilerplate code #10703

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 7 commits into from
Jun 19, 2019
Merged

Conversation

AnttiKauppila
Copy link

@AnttiKauppila AnttiKauppila commented May 29, 2019

Description

Some boiler plate code removed to reduce memory footprint. This is done by adding new functions to ATHandler so no API breaks are introduced. Only BG96 target is updated to take new functions into use. Other targets are using existing methods.

For BG96 this reduces flash size about 1,3kB

Pull request type

[ ] Fix
[X] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@AriParkkila @kivaisan @jarvte @mirelachirica

Release Notes

@AnttiKauppila AnttiKauppila force-pushed the optimisation branch 2 times, most recently from 92a285a to 9ddf3ad Compare May 29, 2019 13:45
@0Grit
Copy link

0Grit commented May 29, 2019

Any chance of HE910 driver getting updated for this refactor? @maclobdell

@AnttiKauppila
Copy link
Author

@loverdeg-ep All other targets will be updated accordingly but not in this PR.

@AnttiKauppila
Copy link
Author

Internal JIRA reference: IOTCELL-2030

@ciarmcom
Copy link
Member

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

@AnttiKauppila
Copy link
Author

Thanks @mirelachirica. Fixed now

* @param resp_buf_size Response buffer size
* @param format Format string for variadic arguments to be added to AT command; No separator needed.
* Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
* @return @return last error that happened when parsing AT responses
Copy link
Contributor

Choose a reason for hiding this comment

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

extra @return, same with some other new doxygens.

* @brief at_cmd_discard Send an AT command and read and discard a response. Locks and unlocks ATHandler for operation
* @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed)
* @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
* @param resp Integer to hold response
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no resp argument

NWRegisteringMode mode;
get_network_registering_mode(mode);

if (mode != NWModeAutomatic) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if mode == NWModeAutomatic then this function does not return anything

@@ -361,8 +325,7 @@ nsapi_error_t AT_CellularNetwork::scan_plmn(operList_t &operators, int &opsCount

_at.lock();

_at.cmd_start("AT+COPS=?");
_at.cmd_stop();
_at.cmd_start_stop("+COPS", "?");
Copy link
Contributor

Choose a reason for hiding this comment

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

missing '=' ?

@40Grit
Copy link

40Grit commented Jun 3, 2019

This is a nit, but the title of this PR has been bothering me.

I'm thinking more along the lines of the following
'''
"Cellular: Refactor 'x' to eliminate redundant logic"
'''
But even that doesn't quite capture the essence of this PR.

@0xc0170

@AnttiKauppila AnttiKauppila changed the title Cellular: Removed boiler plate code Cellular: Removed boilerplate code Jun 4, 2019
@AnttiKauppila
Copy link
Author

@jarvte good catches, fixed now.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 13, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 13, 2019

CI restarted

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2019

Test run: FAILED

Summary: 1 of 7 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 14, 2019

There's fix proposed in #10833, will restart CI after

@AnttiKauppila
Copy link
Author

IAR Fastmodel was broken and is fixed: #10833.
@adbridge @0xc0170 Please retrigger build

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 14, 2019

as soon as the fix lands , will do

@AnttiKauppila
Copy link
Author

Sorry it is not yet merged :(

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 15, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test

@adbridge
Copy link
Contributor

Seem to be many random CI failures over the weekend, restarting CI

@mbed-ci
Copy link

mbed-ci commented Jun 17, 2019

Test run: FAILED

Summary: 2 of 11 test jobs failed
Build number : 5
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
  • jenkins-ci/mbed-os-ci_greentea-test

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 18, 2019

Test run: SUCCESS

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

@AnttiKauppila
Copy link
Author

@adbridge @0xc0170 Can you merge this?

@adbridge adbridge merged commit 6000724 into ARMmbed:master Jun 19, 2019
@AnttiKauppila AnttiKauppila deleted the optimisation branch June 19, 2019 12: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.