|
JBImprov
Improv Wi-Fi provisioning over serial and Bluetooth LE
|
Improv Serial transport on any Arduino Stream (Serial, Serial1, USB CDC...). More...
#include <JBImprovSerial.h>
Public Member Functions | |
| JBImprovSerial (Stream &stream) | |
Use stream, which must outlive this object. | |
| void | setAutoRead (bool autoRead) |
| Read the stream from JBImprov::loop() (default true). | |
| bool | handleByte (uint8_t byte) |
| Process one byte received from the client. | |
Protected Member Functions | |
| 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). | |
| bool | scanResultsPerNetwork () override |
| Protected Member Functions inherited from JBImprovTransport | |
| virtual void | begin () |
| Called from JBImprov::begin(). | |
| virtual bool | isAuthorized () |
| true if commands that change the device are allowed now. | |
| virtual void | authorizationUsed () |
| Called after an authorized command was used, to restart an authorization timeout. | |
| 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 Serial transport on any Arduino Stream (Serial, Serial1, USB CDC...).
The stream must be started (e.g. Serial.begin(115200)) by the application.
| bool JBImprovSerial::handleByte | ( | uint8_t | byte | ) |
Process one byte received from the client.
|
overrideprotectedvirtual |
Handle a command whose meaning depends on the transport (0x02).
Reimplemented from JBImprovTransport.
|
overrideprotectedvirtual |
Called from JBImprov::loop().
Reimplemented from JBImprovTransport.
|
inlineoverrideprotectedvirtual |
true to send one RPC result per scanned network (serial), false for one combined result (BLE).
Reimplemented from JBImprovTransport.
|
overrideprotectedvirtual |
Write an error state to the client. Use setError() instead, it skips repeats.
Implements JBImprovTransport.
|
overrideprotectedvirtual |
Send an RPC result. data holds length prefixed strings.
Implements JBImprovTransport.
|
overrideprotectedvirtual |
Report the provisioning state. Called on every change and when asked.
Implements JBImprovTransport.
|
inline |
Read the stream from JBImprov::loop() (default true).
Turn it off if the application reads the stream itself and passes every byte to handleByte().