Value of %iswifi% variable

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Value of %iswifi% variable

#1 Post by mackowiakp » 22 May 2021, 11:04

What does it mean value of %iswifi% system variable?
In my case it shows "7".
Does it mean that if value is grater then "0" that mean that WiFi is connected and when equal "0" disconnected?

TD-er
Core team member
Posts: 8729
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Value of %iswifi% variable

#2 Post by TD-er » 22 May 2021, 11:08

Yes and no ;)

It is a set of bits.
These are the bit positions (taken from WiFiEventData.cpp)

Code: Select all

#define ESPEASY_WIFI_CONNECTED               0
#define ESPEASY_WIFI_GOT_IP                  1
#define ESPEASY_WIFI_SERVICES_INITIALIZED    2
Thus:
0 = disconnected
1 = Connected
3 = Got IP && Connected
7 = Got IP && Connected && Completed to set all flags WiFi is initialized.

Other values can occur, but shouldn't. (at least not for long)

mackowiakp
Normal user
Posts: 531
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: Value of %iswifi% variable

#3 Post by mackowiakp » 22 May 2021, 11:16

THX. Clear for me !

Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests