arduino-emulator
Loading...
Searching...
No Matches
WiFi.h
1/*
2 WiFi.h
3 Copyright (c) 2025 Phil Schatzmann. All right reserved.
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18*/
19#pragma once
20
21#include "WiFiClient.h"
22#include "WiFiClientSecure.h"
23#include "WiFiServer.h"
24
32namespace arduino {
33
34enum wifi_ps_type_t { WIFI_PS_NONE, WIFI_PS_MIN_MODEM, WIFI_PS_MAX_MODEM };
35
36class WifiMock {
37 public:
38 virtual void begin(const char* name, const char* pwd) {
39 // nothing to be done
40 }
41
42 // we assume the network to be available on a desktop or host machine
43 wl_status_t status() { return WL_CONNECTED; }
44
45 IPAddress& localIP() {
46 SocketImpl sock;
47 adress.fromString(sock.getIPAddress());
48 return adress;
49 }
50
51 void setSleep(bool) {}
52
53 void setSleep(wifi_ps_type_t) {}
54
55 int macAddress() { return mac; }
56
57 void setClientInsecure() {}
58
59 protected:
60 IPAddress adress;
61 int mac = 0;
62};
63
64extern WifiMock WiFi;
65
66} // namespace arduino
Definition DMAPool.h:103
Definition IPAddress.h:43
Definition SocketImpl.h:26
Definition WiFi.h:36
We provide the WiFi class to simulate the Arduino WIFI. In in Linux we can expect that networking is ...
Definition CanMsg.cpp:31