[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
IMPORTANT CELLULAR FIX for context activation with some MNO profiles.…
Browse files Browse the repository at this point in the history
… (#1163)

In commit ac08677 (related to LENA-R8), the code that checks cellular context activation was optimised to reduce the number of times it went around a for() loop.  However, this optimisation did not work for certain MNO profiles, profiles which explicitly require the module to employ a default PDP context (context 0) was well as the requested context, hence the optimisation is removed.

Our thanks to jraats for pointing out the problem.
  • Loading branch information
RobMeades authored May 8, 2024
1 parent 29a9787 commit ed77521
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cell/src/u_cell_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,13 +1662,9 @@ static int32_t activateContext(const uCellPrivateInstance_t *pInstance,
bool activated = false;
bool ours;
bool cgActCalled;
size_t maxNumContexts = 1;

deviceError.type = U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR;
uAtClientLock(atHandle);
if (pInstance->pModule->pppContextId >= 0) {
maxNumContexts++;
}
for (size_t x = 5; (x > 0) && keepGoingLocalCb(pInstance) &&
(errorCode != 0) &&
((deviceError.type == U_AT_CLIENT_DEVICE_ERROR_TYPE_NO_ERROR) ||
Expand All @@ -1692,7 +1688,7 @@ static int32_t activateContext(const uCellPrivateInstance_t *pInstance,
uAtClientCommandStart(atHandle, "AT+CGACT?");
uAtClientCommandStop(atHandle);
ours = false;
for (size_t y = 0; (y < maxNumContexts) && !ours; y++) {
for (size_t y = 0; (y < U_CELL_NET_MAX_NUM_CONTEXTS) && !ours; y++) {
uAtClientResponseStart(atHandle, "+CGACT:");
// Check if this is our context ID
if (uAtClientReadInt(atHandle) == contextId) {
Expand Down

0 comments on commit ed77521

Please sign in to comment.