This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
POSSIBLY BREAKING CHANGE to cellular: APN username/password fields. (…
…#1028) Preface: you only need to worry about any of this if you are required to specify a user name and password with the APN supplied by your service provider. The "POSSIBLY BREAKING" aspect of it is that three new fields are added to the end of the uNetworkCfgCell_t structure that is passed to uNetworkInterfaceUp() for a cellular device: assuming you are using a const struct then your compiler will initialise these extra fields to zero and that will be fine; if for some reason you are not using a const struct, please be sure to memset() it to zero before populating it. The cellular uCellNetConnect() and uCellNetActivate() functions support being given a pUsername/pPassword pair to go with the APN, where required by the service provider. There are two problems with this: - no "authentication mode" field is included: for SARA-U201 and SARA-R5 this is fine as those modules support figuring out the authentication mode automatically, however, SARA-R4, LARA-R6 and the up-coming LENA-R8 do not, hence it is necessary for the application to set the authentication mode explicitly, - the pUsername and pPassword fields are not included in the uNetworkCfgCell_t structure passed to uNetworkInterfaceUp() for a cellular device: this was done as a deliberate simplification, since the user name and password fields are relatively rarely required (having to specify the APN is bad enough); however, there are some cases where the fields are required, meaning the application has to drop back to calling uCellNetConnect() directly, which is not ideal. With this commit the following changes are made: - two new functions, uCellNetGetAuthenticationMode() and uCellNetSetAuthenticationMode(), are added to the uCellNet API. Where a module supports automatic authentication mode, uCellNetGetAuthenticationMode() will return U_CELL_NET_AUTHENTICATION_MODE_AUTOMATIC and all will be fine. If a module does NOT support automatic authentication mode (i.e. for SARA-R4, LARA-R6 and the up-coming LENA-R8) then, if you are required to supply a user name and password with your APN, you must call uCellNetSetAuthenticationMode() to set the appropriate mode explicitly; your service provider will indicate PAP (U_CELL_NET_AUTHENTICATION_MODE_PAP) or CHAP (U_CELL_NET_AUTHENTICATION_MODE_CHAP). - three new fields, pUsername, pPassword and authenticationMode, are added to the end of the uNetworkCfgCell_t structure that is passed to uNetworkInterfaceUp() for a cellular device; if you need to pass a user name or password along with the APN then you may populate pUsername and pPassword and, if your module does not support automatic authentication mode, you must also populate the authenticationMode field; there is no harm in populating the authenticationMode field anyway, even if your module does support automatic authentication mode.
- Loading branch information
Showing
21 changed files
with
604 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.