Calling Cellular.disconnect() don't prevent the system from trying to reconnect

Hi.
I’m new to this forum and I tried to find here more information about the method Cellular.disconnect(), but I wasn’t able to find a solution to my problem.

I’m trying to prevent the system from trying to reconnect if the signal is too bad by using SYSTEM_MODE(MANUAL) and SYSTEM_THREAD(ENABLED), but calling disconnect, only disconnects the system for a brief period of time. And turning off the Cellular prevents me from getting the signal strength.
I was looking into the firmware code to see what kind of method would stop the connection process from being recalled, but no success so far.

Is there any to keep the Cellular On but disconnected after a connection was issued?

Thanks in advance

With the code below it’s easy to reproduce the behavior described in my last post.

#include "Particle.h"

SerialLogHandler logHandler;
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(MANUAL);


void setup(){
    Serial.begin(9600);
    Cellular.on();
}
void loop() {
    while(Serial.available()){
        char ch = Serial.read();
        if (ch=='C'){
           Cellular.connect();
        }
        else if(ch=='D'){
           Cellular.disconnect();
        }
    }
}

@legionaryu, which version of the system firmware is running on the Electron?

@peekay123 It’s running the version 0.6.2

@legionaryu, my Electron is at 0.7.0-rc.3 so I will to test tonight. Are your running a 3rd party SIM? It may be worth surrounding the connect() and disconnect() calls with checks to connecting() and ready() to prevent duplicate calls. Once connect is called, there should be a five minute timeout on connecting() or on ready() for example. I am not sure what the timeout should be when disconnecting.

I think I recall @rickkas7 having posted an FSM for managing the connecting/disconnecting states. Perhaps he can shed some light here as well.

@peekay123, do you know if there is any way to decrease this 5 minutes timeout?

@legionaryu, you can make that timeout what you want but you have to give the modem up to 5 minutes to connect.