JBImprov
Improv Wi-Fi provisioning over serial and Bluetooth LE
Loading...
Searching...
No Matches
JBImprovTransport Class Referenceabstract

Base class for the ways a client can talk to the device. More...

#include <JBImprov.h>

Inheritance diagram for JBImprovTransport:
JBImprovBLE JBImprovSerial

Protected Member Functions

virtual void begin ()
 Called from JBImprov::begin().
virtual void loop ()
 Called from JBImprov::loop().
virtual void sendState (JBImprovState state)=0
 Report the provisioning state. Called on every change and when asked.
virtual void sendError (JBImprovError error)=0
 Write an error state to the client. Use setError() instead, it skips repeats.
virtual void sendResult (uint8_t command, const uint8_t *data, uint8_t length)=0
 Send an RPC result. data holds length prefixed strings.
virtual bool handleTransportCommand (uint8_t command, const uint8_t *data, uint8_t length)
 Handle a command whose meaning depends on the transport (0x02).
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.
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.

Protected Attributes

JBImprov * _improv = nullptr
 The JBImprov instance this transport was added to.
JBImprovError _lastError = JBImprovError::None
 The last error state sent, used by setError().

Friends

class JBImprov

Detailed Description

Base class for the ways a client can talk to the device.

Applications don't call these methods; they are used by JBImprov.

Member Function Documentation

◆ authorizationUsed()

virtual void JBImprovTransport::authorizationUsed ( )
inlineprotectedvirtual

Called after an authorized command was used, to restart an authorization timeout.

Reimplemented in JBImprovBLE.

◆ begin()

virtual void JBImprovTransport::begin ( )
inlineprotectedvirtual

Called from JBImprov::begin().

Reimplemented in JBImprovBLE.

◆ handleTransportCommand()

virtual bool JBImprovTransport::handleTransportCommand ( uint8_t command,
const uint8_t * data,
uint8_t length )
inlineprotectedvirtual

Handle a command whose meaning depends on the transport (0x02).

Returns
true if handled.

Reimplemented in JBImprovBLE, and JBImprovSerial.

◆ isAuthorized()

virtual bool JBImprovTransport::isAuthorized ( )
inlineprotectedvirtual

true if commands that change the device are allowed now.

Reimplemented in JBImprovBLE.

◆ loop()

virtual void JBImprovTransport::loop ( )
inlineprotectedvirtual

Called from JBImprov::loop().

Reimplemented in JBImprovBLE, and JBImprovSerial.

◆ scanResultsPerNetwork()

virtual bool JBImprovTransport::scanResultsPerNetwork ( )
inlineprotectedvirtual

true to send one RPC result per scanned network (serial), false for one combined result (BLE).

Reimplemented in JBImprovSerial.

◆ sendError()

virtual void JBImprovTransport::sendError ( JBImprovError error)
protectedpure virtual

Write an error state to the client. Use setError() instead, it skips repeats.

Implemented in JBImprovBLE, and JBImprovSerial.

◆ sendResult()

virtual void JBImprovTransport::sendResult ( uint8_t command,
const uint8_t * data,
uint8_t length )
protectedpure virtual

Send an RPC result. data holds length prefixed strings.

Implemented in JBImprovBLE, and JBImprovSerial.

◆ sendState()

virtual void JBImprovTransport::sendState ( JBImprovState state)
protectedpure virtual

Report the provisioning state. Called on every change and when asked.

Implemented in JBImprovBLE, and JBImprovSerial.


The documentation for this class was generated from the following files: