#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#ifndef STASSID
#define STASSID "wlanName"
#define STAPSK "wlanPassword"
#endif
const char* ssid = STASSID;
const char* password = STAPSK;
const char* host = "api.github.com";
const int httpsPort = 443;
const char fingerprint[] PROGMEM = "5F F1 60 31 09 04 3E F2 90 D2 B0 8A 50 38 04 E8 37 9F BC 76";
void setup() {
Serial.begin(115200);
delay(5000);
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (true) {
delay(500);
Serial.print(WiFi.status());
}
}
void loop() {
// put your main code here, to run repeatedly:
}
如果我运行这段代码,我会得到 6 作为输出Wifi.status()
,一旦我也得到 4。4 和 6 代表什么?是连接还是不连接?我还需要知道哪些其他状态代码?