QuestionsCategory: General Questioninvalid-conversion-from-ip4_addr-to-ip_addr-fpermissive
Rutvi asked 5 years ago

#include <ESP8266WiFi.h>#include <WiFiClient.h>#include <ESP8266WebServer.h> //Header File to get information about clientextern \”C\” {#include<user_interface.h> } //Hotspot Name and Passwordconst char* ssid = \”ESPtest\”;const char* password = \”12345678\”; ESP8266WebServer server(80); //Server on port 80 void handleRoot() { server.send(200, \”text/plain\”, \”Thank You for using http://www.mybtechprojects.tech\”);} void client_status(){ unsigned char number_client;struct station_info *stat_info; struct ip_addr *IPAddress;//IPAddress address;int i=1; number_client= wifi_softap_get_station_num();stat_info = wifi_softap_get_station_info(); Serial.print(\” Total connected_client are = \”);Serial.println(number_client); while (stat_info != NULL) { IPAddress = &stat_info->ip;address = IPaddress->addr; Serial.print(\”Client = \”); Serial.print(i);Serial.println();Serial.print(\” Ip adress is = \”);Serial.println((address));Serial.print(\”Mac adress is = \”); Serial.print(stat_info->bssid[0],HEX);Serial.print(stat_info->bssid[1],HEX);Serial.print(stat_info->bssid[2],HEX);Serial.print(stat_info->bssid[3],HEX);Serial.print(stat_info->bssid[4],HEX);Serial.println(stat_info->bssid[5],HEX); stat_info = STAILQ_NEXT(stat_info, next);i++;Serial.println(); }delay(500);} void setup(){ Serial.begin(9600); Serial.println(\”\”); WiFi.mode(WIFI_AP); //For WI-FI with Password. WiFi.softAP(ssid,password); //For WI-FI without Password // WiFi.softAP(ssid); IPAddress myIP = WiFi.softAPIP(); Serial.print(\”HotSpot IP:\”); Serial.println(myIP); server.on(\”/\”, handleRoot); server.begin(); Serial.println(\”HTTP server started\”);} void loop(){ client_status(); server.handleClient(); }