phyphox BLE
Plot your Arduino's data in the phyphox app and control the board from the phone
Loading...
Searching...
No Matches
ArduinoBleTransport.h
Go to the documentation of this file.
1// Transport for the ArduinoBLE API: ArduinoBLE (Nano 33 BLE / IoT, UNO R4 WiFi, MKR WiFi 1010,
2// Nano RP2040 Connect, Portenta, GIGA) and STM32duinoBLE (same API, different include).
3// Notifications are flow-controlled by the library itself: BLECharacteristic::writeValue()
4// blocks until the controller has a free buffer (HCI.cpp, sendAclPkt), so notify() never
5// returns false here. Requires PhyphoxBLE::poll() in loop() (BLE.poll()).
6#ifndef PHYPHOX_BLE_TRANSPORT_ARDUINOBLE_H
7#define PHYPHOX_BLE_TRANSPORT_ARDUINOBLE_H
8
9#include "Transport.h"
10
11namespace phyphox {
12
14public:
15 bool begin(const GattLayout& layout, TransportListener& listener) override;
16 bool notify(CharId id, const uint8_t* data, uint16_t len) override;
17 void setValue(CharId id, const uint8_t* data, uint16_t len) override;
18 bool connected() const override;
19 uint16_t mtuPayload() const override;
20 void requestMtu(uint16_t payload) override;
21 void requestConnectionParameters(uint16_t, uint16_t, uint16_t, uint16_t) override;
22 void poll() override;
23 void restartAdvertising() override;
24 const char* name() const override { return "ArduinoBLE"; }
26private:
28 // Both transfer triggers: BLESubscribed on the experiment characteristic and a write of 1
29 // to the control characteristic (docs: either is allowed).
30};
31
32} // namespace phyphox
33
34#endif
Definition ArduinoBleTransport.h:13
void restartAdvertising() override
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 connected() const override
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 notify(CharId id, const uint8_t *data, uint16_t len) override
Send a notification.
const char * name() const override
"ArduinoBLE", "ESP32", "NINA-B31" — for printXML/debug
Definition ArduinoBleTransport.h:24
bool begin(const GattLayout &layout, TransportListener &listener) override
Create services and characteristics, start advertising the experiment service.
void requestMtu(uint16_t payload) override
Ask the stack for an MTU before connecting (ESP32 only today; others ignore).
uint16_t mtuPayload() const override
The negotiated MTU payload (ATT_MTU − 3), or PHYPHOX_BLE_DEFAULT_MTU.
static ArduinoBleTransport & instance()
Callbacks from the transport into the core (implemented by Server).
Definition Transport.h:40
Definition Transport.h:59
Definition ChannelStore.h:11
Definition Transport.h:23
What the core asks the transport to create at begin().
Definition Transport.h:29