phyphox BLE
Plot your Arduino's data in the phyphox app and control the board from the phone
Loading...
Searching...
No Matches
phyphox::Esp32CoreBleTransport Class Reference

#include <Esp32CoreBleTransport.h>

Inheritance diagram for phyphox::Esp32CoreBleTransport:

Public Member Functions

bool begin (const GattLayout &layout, TransportListener &listener) override
 Create services and characteristics, start advertising the experiment service.
 
bool notify (CharId id, const uint8_t *data, uint16_t len) override
 Send a notification.
 
void setValue (CharId id, const uint8_t *data, uint16_t len) override
 Set a characteristic's value without notifying (initial values, the legacy config).
 
bool connected () const override
 
uint16_t mtuPayload () const override
 The negotiated MTU payload (ATT_MTU − 3), or PHYPHOX_BLE_DEFAULT_MTU.
 
void requestMtu (uint16_t payload) override
 Ask the stack for an MTU before connecting (ESP32 only today; others ignore).
 
void requestConnectionParameters (uint16_t, uint16_t, uint16_t, uint16_t) override
 Ask the central for connection parameters (units of 1.25 ms / 10 ms).
 
void poll () override
 Give the stack CPU time.
 
bool drivesTransfer () const override
 True if the transport calls listener.pump() from a task of its own, so the core must not also pump from poll() (ESP32: the sketch's loop() may be slow, and a transfer must not run inside a stack callback).
 
void restartAdvertising () override
 
const char * name () const override
 "ArduinoBLE", "ESP32", "NINA-B31" — for printXML/debug
 
- Public Member Functions inherited from phyphox::Transport
virtual ~Transport ()
 
virtual bool asyncNotifyStatus () const
 True if the verdict on notify() arrives later through onNotifyStatus() (ESP32); false if notify()'s return value is the verdict (ArduinoBLE, NINA-B31).
 

Static Public Member Functions

static Esp32CoreBleTransport & instance ()
 

Member Function Documentation

◆ begin()

bool phyphox::Esp32CoreBleTransport::begin ( const GattLayout &  layout,
TransportListener &  listener 
)
overridevirtual

Create services and characteristics, start advertising the experiment service.

Implements phyphox::Transport.

◆ connected()

bool phyphox::Esp32CoreBleTransport::connected ( ) const
overridevirtual

Implements phyphox::Transport.

◆ drivesTransfer()

bool phyphox::Esp32CoreBleTransport::drivesTransfer ( ) const
inlineoverridevirtual

True if the transport calls listener.pump() from a task of its own, so the core must not also pump from poll() (ESP32: the sketch's loop() may be slow, and a transfer must not run inside a stack callback).

Reimplemented from phyphox::Transport.

◆ instance()

static Esp32CoreBleTransport & phyphox::Esp32CoreBleTransport::instance ( )
static

◆ mtuPayload()

uint16_t phyphox::Esp32CoreBleTransport::mtuPayload ( ) const
overridevirtual

The negotiated MTU payload (ATT_MTU − 3), or PHYPHOX_BLE_DEFAULT_MTU.

Implements phyphox::Transport.

◆ name()

const char * phyphox::Esp32CoreBleTransport::name ( ) const
inlineoverridevirtual

"ArduinoBLE", "ESP32", "NINA-B31" — for printXML/debug

Implements phyphox::Transport.

◆ notify()

bool phyphox::Esp32CoreBleTransport::notify ( CharId  id,
const uint8_t *  data,
uint16_t  len 
)
overridevirtual

Send a notification.

Returns false if the stack refused it right now (buffers full): the core will retry. A transport that blocks until accepted (ArduinoBLE) returns true. A transport that only learns the verdict later (ESP32) returns true and reports via onNotifyStatus().

Implements phyphox::Transport.

◆ poll()

void phyphox::Esp32CoreBleTransport::poll ( )
inlineoverridevirtual

Give the stack CPU time.

Called from PhyphoxBLE::poll(); a no-op where the stack runs on its own (ESP32).

Implements phyphox::Transport.

◆ requestConnectionParameters()

void phyphox::Esp32CoreBleTransport::requestConnectionParameters ( uint16_t  minInterval,
uint16_t  maxInterval,
uint16_t  latency,
uint16_t  timeout 
)
overridevirtual

Ask the central for connection parameters (units of 1.25 ms / 10 ms).

Transports that cannot ignore it. The core only passes Apple-compliant values (min >= 15 ms, max >= min + 15 ms).

Reimplemented from phyphox::Transport.

◆ requestMtu()

void phyphox::Esp32CoreBleTransport::requestMtu ( uint16_t  payload)
overridevirtual

Ask the stack for an MTU before connecting (ESP32 only today; others ignore).

Reimplemented from phyphox::Transport.

◆ restartAdvertising()

void phyphox::Esp32CoreBleTransport::restartAdvertising ( )
overridevirtual

Implements phyphox::Transport.

◆ setValue()

void phyphox::Esp32CoreBleTransport::setValue ( CharId  id,
const uint8_t *  data,
uint16_t  len 
)
overridevirtual

Set a characteristic's value without notifying (initial values, the legacy config).

Implements phyphox::Transport.


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