|
JBImprov
Improv Wi-Fi provisioning over serial and Bluetooth LE
|
Wi-Fi operations needed by JBImprov. More...
#include <JBImprovWiFi.h>
Public Types | |
| enum class | ConnectStatus : uint8_t { Connecting , Connected , Failed } |
| Result of connectStatus(). More... | |
Public Member Functions | |
| virtual void | begin () |
| Called from JBImprov::begin(). | |
| virtual bool | isConnected ()=0 |
| true when connected to a network and an IP address is assigned. | |
| virtual bool | connect (const char *ssid, const char *password, const char *hostname)=0 |
| Start connecting to a network. Must return without waiting. | |
| virtual ConnectStatus | connectStatus ()=0 |
| Progress of the attempt started by connect(). | |
| virtual void | cancelConnect () |
| Called when JBImprov gives up on an attempt (timeout or failure). | |
| virtual bool | localIP (char *buffer, size_t size)=0 |
| Write the local IPv4 address as text. | |
| virtual bool | startScan ()=0 |
| Start an asynchronous scan. | |
| virtual int | scanStatus ()=0 |
| Scan progress: the number of networks found when done, or JBIMPROV_SCAN_RUNNING / JBIMPROV_SCAN_FAILED. | |
| virtual bool | scanResult (int index, JBImprovNetwork &network)=0 |
Get network index (0 based) of the last scan. | |
| virtual void | scanDelete () |
| Free the scan results. | |
| virtual bool | setHostname (const char *hostname) |
| Use a new hostname. It may take effect on the next connection. | |
| virtual bool | defaultHostname (char *buffer, size_t size) |
| Write the hostname to use when none is set. | |
| virtual const char * | hardware () |
| Hardware chip or variant for device info, e.g. "ESP32-S3". | |
| virtual const char * | osName () |
| Name of the OS or framework for device info, or nullptr to leave it out. | |
| virtual const char * | osVersion () |
| Version of the OS or framework for device info, or nullptr to leave it out. | |
Wi-Fi operations needed by JBImprov.
All methods are called from JBImprov::loop() and must not block for long.
|
strong |
Result of connectStatus().
| Enumerator | |
|---|---|
| Connecting | Still trying. |
| Connected | Connected and has an IP address. |
| Failed | Gave up, e.g. wrong password. A timeout is handled by JBImprov. |
|
inlinevirtual |
Called from JBImprov::begin().
Reimplemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Called when JBImprov gives up on an attempt (timeout or failure).
Reimplemented in JBImprovDefaultWiFi.
|
pure virtual |
Start connecting to a network. Must return without waiting.
| ssid | Network name. |
| password | Empty string for an open network. |
| hostname | Hostname to use, may be empty. |
Implemented in JBImprovDefaultWiFi.
|
pure virtual |
Progress of the attempt started by connect().
Implemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Write the hostname to use when none is set.
Reimplemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Hardware chip or variant for device info, e.g. "ESP32-S3".
Reimplemented in JBImprovDefaultWiFi.
|
pure virtual |
true when connected to a network and an IP address is assigned.
Implemented in JBImprovDefaultWiFi.
|
pure virtual |
Write the local IPv4 address as text.
Implemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Name of the OS or framework for device info, or nullptr to leave it out.
Reimplemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Version of the OS or framework for device info, or nullptr to leave it out.
Reimplemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Free the scan results.
Reimplemented in JBImprovDefaultWiFi.
|
pure virtual |
Get network index (0 based) of the last scan.
Implemented in JBImprovDefaultWiFi.
|
pure virtual |
Scan progress: the number of networks found when done, or JBIMPROV_SCAN_RUNNING / JBIMPROV_SCAN_FAILED.
Implemented in JBImprovDefaultWiFi.
|
inlinevirtual |
Use a new hostname. It may take effect on the next connection.
Reimplemented in JBImprovDefaultWiFi.
|
pure virtual |
Start an asynchronous scan.
Implemented in JBImprovDefaultWiFi.