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

#include <NinaB31Transport.h>

Inheritance diagram for phyphox::NinaB31Transport:

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 poll () override
 Give the stack CPU time.
 
void restartAdvertising () override
 
const char * name () const override
 "ArduinoBLE", "ESP32", "NINA-B31" — for printXML/debug
 
void setTrace (Print *out)
 Mirror the AT dialogue with the module ("> " sent, "< " received) on out; nullptr stops it.
 
- 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).
 
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 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).
 

Static Public Member Functions

static NinaB31Transport & instance ()
 

Member Function Documentation

◆ begin()

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

Create services and characteristics, start advertising the experiment service.

Implements phyphox::Transport.

◆ connected()

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

Implements phyphox::Transport.

◆ instance()

static NinaB31Transport & phyphox::NinaB31Transport::instance ( )
static

◆ mtuPayload()

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

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

Implements phyphox::Transport.

◆ name()

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

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

Implements phyphox::Transport.

◆ notify()

bool phyphox::NinaB31Transport::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::NinaB31Transport::poll ( )
overridevirtual

Give the stack CPU time.

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

Implements phyphox::Transport.

◆ restartAdvertising()

void phyphox::NinaB31Transport::restartAdvertising ( )
overridevirtual

Implements phyphox::Transport.

◆ setTrace()

void phyphox::NinaB31Transport::setTrace ( Print *  out)

Mirror the AT dialogue with the module ("> " sent, "< " received) on out; nullptr stops it.

PhyphoxBLE::begin(&Serial) calls this. -DPHYPHOX_BLE_NINA_TRACE does the same at compile time.

◆ setValue()

void phyphox::NinaB31Transport::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: