Skip to content

getStatus() help #8

@salvq

Description

@salvq

Hello, not sure if this is issue or just I am newbie and do not know how to correctly call the function :)

I am using this connection handler for GSM MKR connection to cellular network. In my routines I would like to check what is current status of the network and use it for if condition i.e. do not execute condition in main loop until modem is connected.

    if ( (millis()-s2) > 50000 && CONNECTIONREADY) {
       s2 = millis();

       Serial.println("Fifty SECONDS");
    }

However, firstly I tried to insert boolean into routine (CONNECTED) but this boolean gets reseted once get out from the routine and in main loop value is always 0 and do not know why. Can you help to understand why is that ? :)

void onNetworkConnect(void *_arg) {
  Serial.println(">>>> CONNECTED to network");
  bool CONNECTIONREADY = true;
}

Is there better way to set CONNECTIONREADY to 1 or use function which is mention on the readme getStatus(). It says it returns the status, which variable I can read this value from ? Why I can not just read this information without using getStatus() ? How to add it to my if routine to validate condition in main loop ?

Please help me with this,
Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions