|
JBImprov
Improv Wi-Fi provisioning over serial and Bluetooth LE
|
Improv BLE transport using the ESP32 BLE library. More...
#include <JBImprovBLE.h>
Public Member Functions | |
| void | setAuthorizationRequired (bool required) |
| Require physical authorization before credentials are accepted. | |
| void | setAuthorizationTimeout (uint32_t milliseconds) |
| How long an authorization lasts. | |
| void | authorize () |
| Authorize the client, e.g. when a button is pressed. Lasts the authorization timeout. | |
| bool | isAuthorized () override |
| true if credentials are accepted right now. | |
| void | setAdvertiseWhenProvisioned (bool advertise) |
| Keep advertising after the device is provisioned (default false). | |
| bool | isClientConnected () const |
| true while a client is connected. | |
Protected Member Functions | |
| void | begin () override |
| Called from JBImprov::begin(). | |
| void | loop () override |
| Called from JBImprov::loop(). | |
| void | sendState (JBImprovState state) override |
| Report the provisioning state. Called on every change and when asked. | |
| void | sendError (JBImprovError error) override |
| Write an error state to the client. Use setError() instead, it skips repeats. | |
| void | sendResult (uint8_t command, const uint8_t *data, uint8_t length) override |
Send an RPC result. data holds length prefixed strings. | |
| bool | handleTransportCommand (uint8_t command, const uint8_t *data, uint8_t length) override |
| Handle a command whose meaning depends on the transport (0x02). | |
| void | authorizationUsed () override |
| Called after an authorized command was used, to restart an authorization timeout. | |
| Protected Member Functions inherited from JBImprovTransport | |
| virtual bool | scanResultsPerNetwork () |
| void | handleCommand (uint8_t command, const uint8_t *data, uint8_t length) |
| Pass a received RPC command to JBImprov. | |
| void | setError (JBImprovError error) |
| Report an error state if it differs from the last one sent. | |
Additional Inherited Members | |
| Protected Attributes inherited from JBImprovTransport | |
| JBImprov * | _improv = nullptr |
| The JBImprov instance this transport was added to. | |
| JBImprovError | _lastError = JBImprovError::None |
| The last error state sent, used by setError(). | |
Improv BLE transport using the ESP32 BLE library.
Owns the BLE stack (BLEDevice::init()), so don't use it together with other BLE server code. The advertised name is the device name.
|
inlineoverrideprotectedvirtual |
Called after an authorized command was used, to restart an authorization timeout.
Reimplemented from JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Called from JBImprov::begin().
Reimplemented from JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Handle a command whose meaning depends on the transport (0x02).
Reimplemented from JBImprovTransport.
|
inlineoverridevirtual |
true if credentials are accepted right now.
Reimplemented from JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Called from JBImprov::loop().
Reimplemented from JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Write an error state to the client. Use setError() instead, it skips repeats.
Implements JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Send an RPC result. data holds length prefixed strings.
Implements JBImprovTransport.
|
inlineoverrideprotectedvirtual |
Report the provisioning state. Called on every change and when asked.
Implements JBImprovTransport.
|
inline |
Keep advertising after the device is provisioned (default false).
The specification stops the Improv service once provisioned. Turn this on to allow changing the network over BLE later.
|
inline |
Require physical authorization before credentials are accepted.
When on, the device reports "authorization required" until authorize() is called, for example from a button press. Off by default, which lets anyone in range provision the device while it isn't connected.