Skip to content

Conversation

@AriParkkila
Copy link

@AriParkkila AriParkkila commented Sep 20, 2018

Description

Fixed cellular network connect and disconnect to handle PDP context more gracefully.

Commit 1: Fix Greentea

  • UDP test to call network.disconnect().

Commit 2: Fix ATHandler

  • To have mutex locks when modifying URC handlers
  • Add sync() AT stream that is needed for PPP disconnect

Commit 3: Add to Cellular network

  • Update network registration to have also deregistration
  • Add a new function to get active cellular context
  • Deactivate PDP context only if it was activated by us (also in PPP mode)

Commit 4: Change cellular statemachine

  • During registration check if PDP context is already useful and continue to attach

Pull request type

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

@AriParkkila
Copy link
Author

@mirelachirica @jarvte please review

@0xc0170 0xc0170 requested a review from a team September 20, 2018 09:28
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't know if it's activated until you check the error from athandler

Copy link
Contributor

Choose a reason for hiding this comment

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

even if there is an error in ppp disconnect we should take control of filehandle to athandler and deactivate context.
Reasoning: ppp disconnect in any case releases filehandle

Copy link
Contributor

Choose a reason for hiding this comment

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

only deactive ... :)

Copy link
Contributor

Choose a reason for hiding this comment

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

not in line with disconnect methods where we call NSAPI_STATUS_DISCONNECTED only in case of success

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we return nsapi_error_t e.g. : return _is_context_active ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_CONNECTION;
and give cid as reference?

@AriParkkila
Copy link
Author

@jarvte please re-review

Copy link
Contributor

Choose a reason for hiding this comment

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

This deregisters from network. Better be done in registration routine not in this detach from PS domain. Set_registration could have true/false param for register/deregister.

Copy link
Contributor

Choose a reason for hiding this comment

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

@AriParkkila Any update required for this PR?

Copy link
Author

Choose a reason for hiding this comment

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

@mirelachirica comment must still be handled, I will try to fix that soon.

@AriParkkila
Copy link
Author

@mirelachirica please review

@mirelachirica
Copy link
Contributor

@AriParkkila Can every bullet in the description, or at least some, be own commit?

@AriParkkila
Copy link
Author

@mirelachirica please review

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 5, 2018

Please review unittest failures

@AriParkkila
Copy link
Author

UnitTests can fixed after #8315 is merged.

@AriParkkila
Copy link
Author

The code base will change and these changes are coming in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants