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

#include <Transport.h>

Inheritance diagram for phyphox::Transport:

Public Member Functions

virtual ~Transport ()
 
virtual bool begin (const GattLayout &layout, TransportListener &listener)=0
 Create services and characteristics, start advertising the experiment service.
 
virtual bool notify (CharId id, const uint8_t *data, uint16_t len)=0
 Send a notification.
 
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).
 
virtual void setValue (CharId id, const uint8_t *data, uint16_t len)=0
 Set a characteristic's value without notifying (initial values, the legacy config).
 
virtual bool connected () const =0
 
virtual uint16_t mtuPayload () const =0
 The negotiated MTU payload (ATT_MTU − 3), or PHYPHOX_BLE_DEFAULT_MTU.
 
virtual void requestMtu (uint16_t payload)
 Ask the stack for an MTU before connecting (ESP32 only today; others ignore).
 
virtual void requestConnectionParameters (uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout)
 Ask the central for connection parameters (units of 1.25 ms / 10 ms).
 
virtual void poll ()=0
 Give the stack CPU time.
 
virtual bool drivesTransfer () const
 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).
 
virtual void restartAdvertising ()=0
 
virtual const char * name () const =0
 "ArduinoBLE", "ESP32", "NINA-B31" — for printXML/debug
 

Constructor & Destructor Documentation

◆ ~Transport()

virtual phyphox::Transport::~Transport ( )
inlinevirtual

Member Function Documentation

◆ asyncNotifyStatus()

virtual bool phyphox::Transport::asyncNotifyStatus ( ) const
inlinevirtual

True if the verdict on notify() arrives later through onNotifyStatus() (ESP32); false if notify()'s return value is the verdict (ArduinoBLE, NINA-B31).

◆ begin()

virtual bool phyphox::Transport::begin ( const GattLayout &  layout,
TransportListener &  listener 
)
pure virtual

Create services and characteristics, start advertising the experiment service.

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.

◆ connected()

virtual bool phyphox::Transport::connected ( ) const
pure virtual

◆ drivesTransfer()

virtual bool phyphox::Transport::drivesTransfer ( ) const
inlinevirtual

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 in phyphox::Esp32Ble4Transport, and phyphox::Esp32CoreBleTransport.

◆ mtuPayload()

virtual uint16_t phyphox::Transport::mtuPayload ( ) const
pure virtual

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

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.

◆ name()

virtual const char * phyphox::Transport::name ( ) const
pure virtual

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

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.

◆ notify()

virtual bool phyphox::Transport::notify ( CharId  id,
const uint8_t *  data,
uint16_t  len 
)
pure virtual

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().

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.

◆ poll()

virtual void phyphox::Transport::poll ( )
pure virtual

Give the stack CPU time.

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

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.

◆ requestConnectionParameters()

virtual void phyphox::Transport::requestConnectionParameters ( uint16_t  minInterval,
uint16_t  maxInterval,
uint16_t  latency,
uint16_t  timeout 
)
inlinevirtual

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 in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, and phyphox::Esp32CoreBleTransport.

◆ requestMtu()

virtual void phyphox::Transport::requestMtu ( uint16_t  payload)
inlinevirtual

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

Reimplemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, and phyphox::Esp32CoreBleTransport.

◆ restartAdvertising()

virtual void phyphox::Transport::restartAdvertising ( )
pure virtual

◆ setValue()

virtual void phyphox::Transport::setValue ( CharId  id,
const uint8_t *  data,
uint16_t  len 
)
pure virtual

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

Implemented in phyphox::ArduinoBleTransport, phyphox::Esp32Ble4Transport, phyphox::Esp32CoreBleTransport, and phyphox::NinaB31Transport.


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