I keep having a problem with the modem connection API, I have tried several tests and I can`t understand why this is still not working.
The application I have made is using an handler for reading the connection status of the modem, problem is that the handler is somehow returning a status which is different from what I read if in the handler itself I try to get the status.
static void StateChangeHandler(le_mdc_ProfileRef_t profileRef,le_mdc_ConState_t ConnectionStatus,void* contextPtr)
LE_ASSERT( le_mdc_GetSessionState(profileRef, &modemState) == LE_OK );
LE_INFO("=====Handler is returning %d while profile status is %d=====", ConnectionStatus, modemState);
static bool sessionAlreadyStopped = false;
where I get logs with =====Handler is returning 0 while profile status is 2===== or vice versa and only occasionally being the same.
I am copying my application where I have tried to use a semaphore and also some global variables, but because the state handler should basically handle the modem connection, and I can
t get how and why I get these not matching status, I cant move on to finalize the software…