ESP8266 arduino AP模块并串口返回连接设备MAC信息
#include <ESP8266WiFi.h>
const char *ssid = "WIFI";
void setup() {
Serial.begin(115200);
Serial.println();
WiFi.softAP(ssid);
}
void loop() {
client_status();
delay(5);
}
void client_status() {
unsigned char number_client;
struct station_info *stat_info;
stat_info = wifi_softap_get_station_info();
while (stat_info != NULL) {
Serial.println(stat_info->bssid[0], HEX);
Serial.println(stat_info->bssid[1], HEX);
Serial.println(stat_info->bssid[2], HEX);
Serial.println(stat_info->bssid[3], HEX);
Serial.println(stat_info->bssid[4], HEX);
Serial.println(stat_info->bssid[5], HEX);
stat_info = STAILQ_NEXT(stat_info, next);
}
//delay(500);
}