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

Cellular: Added BG96 handling for socket closing URC #10411

Merged
merged 1 commit into from Apr 18, 2019

Conversation

Projects
None yet
6 participants
@mirelachirica
Copy link
Contributor

commented Apr 16, 2019

Description

BG96 wasn't handling URC for socket closing at all. Now socket closed flag is set on the arriving of such URC. Also, if the socket was closed but closed flag not yet set at the moment a socket sending/receiving was issued, the socket would get stuck waiting for data. To prevent this, socket event is called also when socket close URC arrives.

Pull request type

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

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Apr 16, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

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

@0xc0170 0xc0170 added needs: work and removed needs: review labels Apr 16, 2019

@mirelachirica mirelachirica force-pushed the mirelachirica:bg96_tcp_endpoint_close branch 2 times, most recently from 19fe543 to 66c15d6 Apr 16, 2019

@blind-owl

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

Change request to:
nsapi_error_t SIMCom_SIM7020_CellularStack::socket_close_impl(....) function

Start function with:
CellularSocket *sock = find_socket(sock_id);
MBED_ASSERT(sock != NULL);
if (sock->closed) {
return NSAPI_ERROR_OK;
}

Justification:
When working other modem driver implementation it was discovered during R&D that if one:

  • closes a socket within the modem , which is already closed it returns an error

Also it makes more sense, as closed flag is enforced, not to issue close to a modem as there is no need => performance optimization

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Apr 17, 2019

@mbed-ci

This comment has been minimized.

Copy link

commented Apr 17, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR
@0xc0170

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

Aborted build, we need CI time for 5.12.2 jobs today

@mirelachirica mirelachirica force-pushed the mirelachirica:bg96_tcp_endpoint_close branch from 66c15d6 to 88ea0db Apr 17, 2019

@mirelachirica

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2019

Change request to:
nsapi_error_t SIMCom_SIM7020_CellularStack::socket_close_impl(....) function

Start function with:
CellularSocket *sock = find_socket(sock_id);
MBED_ASSERT(sock != NULL);
if (sock->closed) {
return NSAPI_ERROR_OK;
}

Justification:
When working other modem driver implementation it was discovered during R&D that if one:

  • closes a socket within the modem , which is already closed it returns an error

Also it makes more sense, as closed flag is enforced, not to issue close to a modem as there is no need => performance optimization

For BG96, closed URC can be followed by AT+QICLOSE command, to close the socket, without error because there is a slight distinction in this case between socket and a connection on that socket. This URC indicates connection being closed.

@mirelachirica

This comment has been minimized.

Copy link
Contributor Author

commented Apr 18, 2019

@blind-owl are the changes made to address your comments ok?

@blind-owl

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

@mirelachirica looks ok.

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Apr 18, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

Ci started

@mbed-ci

This comment has been minimized.

Copy link

commented Apr 18, 2019

Test run: SUCCESS

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

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Apr 18, 2019

@0xc0170 0xc0170 merged commit 46603f8 into ARMmbed:master Apr 18, 2019

26 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage Success
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8626 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8448B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.