TinyWifiDongle 0.1.0
Header-only USB WiFi dongle for Arduino
Loading...
Searching...
No Matches
TinyWifiDongle.h
Go to the documentation of this file.
1#pragma once
25
26#if defined(ESP32)
28#elif defined(ARDUINO_ARCH_RP2040)
30#else
31#error "TinyWifiDongle: unsupported architecture (supported: ESP32-S2/S3/P4, Raspberry Pi Pico W / Pico 2 W)"
32#endif
33
49 public:
51 bool begin(const char* ssid, const char* password = nullptr) {
53 cfg.ssid = ssid;
54 cfg.password = password;
55 return begin(cfg);
56 }
57
59 bool begin(const TinyWifiDongleConfig& cfg) { return port_.begin(cfg); }
60
62 bool isUsbReady() { return port_.usbReady(); }
63
65 bool isWifiConnected() { return port_.uplinkConnected(); }
66
67 protected:
70};
twd::Esp32Dongle TinyWifiDonglePort
Shares the microcontroller's WiFi connection with a USB host.
bool isUsbReady()
True once the USB host has enumerated and configured the adapter.
bool isWifiConnected()
True when the MCU is associated with the WiFi access point.
TinyWifiDonglePort port_
The port of the MCU in use; does all the work.
bool begin(const char *ssid, const char *password=nullptr)
Join ssid and expose the connection over USB.
bool begin(const TinyWifiDongleConfig &cfg)
Start the dongle with full control over all settings.
Settings of the dongle; every field has a usable default except the SSID.
const char * password
Password of the network (nullptr for an open network).
const char * ssid
WiFi network the MCU joins (the "uplink").