21#include "WiFiClient.h"
22#include "WiFiClientSecure.h"
23#include "WiFiServer.h"
31# include <netinet/in.h>
32# include <sys/socket.h>
44typedef enum { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 } WiFiMode_t;
46enum wifi_ps_type_t { WIFI_PS_NONE, WIFI_PS_MIN_MODEM, WIFI_PS_MAX_MODEM };
50 virtual void begin(
const char* name,
const char* pwd) {
55 wl_status_t status() {
return WL_CONNECTED; }
59 adress.fromString(sock.getIPAddress());
63 void setSleep(
bool) {}
65 void setSleep(wifi_ps_type_t) {}
67 int macAddress() {
return mac; }
69 void setClientInsecure() {}
72 void mode(WiFiMode_t m) { wifi_mode = m; }
73 WiFiMode_t getMode() {
return wifi_mode; };
77 bool softAP(
const char* ssid,
const char* passphrase =
nullptr,
78 int channel = 1,
int ssid_hidden = 0,
int max_connection = 4) {
82 bool softAPdisconnect(
bool wifioff =
false) {
86 IPAddress& softAPIP() {
return localIP(); }
90 if (host ==
nullptr)
return 0;
91 if (result.fromString(host))
return 1;
92 struct addrinfo hints;
93 memset(&hints, 0,
sizeof(hints));
94 hints.ai_family = AF_INET;
95 struct addrinfo* info =
nullptr;
96 if (getaddrinfo(host,
nullptr, &hints, &info) != 0 || info ==
nullptr)
return 0;
97 const uint8_t* ip =
reinterpret_cast<const uint8_t*
>(
98 &
reinterpret_cast<struct sockaddr_in*
>(info->ai_addr)->sin_addr.s_addr);
99 result =
IPAddress(ip[0], ip[1], ip[2], ip[3]);
107 WiFiMode_t wifi_mode = WIFI_STA;
Definition IPAddress.h:43
Definition IPAddress.h:43
Definition SocketImpl.h:30
int hostByName(const char *host, IPAddress &result)
Resolves a host name (or an IP address in text form) to an IPv4 address.
Definition WiFi.h:89
bool softAP(const char *ssid, const char *passphrase=nullptr, int channel=1, int ssid_hidden=0, int max_connection=4)
Definition WiFi.h:77
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31