|
phyphox BLE
Plot your Arduino's data in the phyphox app and control the board from the phone
|
Static façade over one phyphox::Server. More...
#include <phyphoxBle.h>
Static Public Member Functions | |
| static void | start (const char *deviceName="phyphox-Arduino") |
Advertise as deviceName ("phyphox-Arduino" by default). | |
| static void | start (const char *deviceName, PhyphoxBleExperiment &experiment) |
Start and serve experiment in one call. | |
| static void | start (const char *deviceName, uint8_t *xml, size_t len) |
| Serve a hand-written phyphox document instead of a generated one (1.x form). | |
| static void | start (uint8_t *xml, size_t len) |
| static void | addExperiment (PhyphoxBleExperiment &experiment) |
| Serve this description (copies it). May be called before or after start(). | |
| static void | poll () |
| Gives the BLE stack CPU time and drives the transfer. | |
| static void | poll (int timeoutMs) |
| 1.x signature; the timeout is ignored | |
| static void | write (const float &v1) |
| static void | write (const float &v1, const float &v2) |
| static void | write (const float &v1, const float &v2, const float &v3) |
| static void | write (const float &v1, const float &v2, const float &v3, const float &v4) |
| static void | write (const float &v1, const float &v2, const float &v3, const float &v4, const float &v5) |
| static void | write (uint8_t *bytes, unsigned int len) |
| Raw arrays, up to the MTU payload; with setRepeating(n) the app unpacks n samples. | |
| static void | write (float *values, unsigned int count) |
| static void | read (float &v1) |
| static void | read (float &v1, float &v2) |
| static void | read (float &v1, float &v2, float &v3) |
| static void | read (float &v1, float &v2, float &v3, float &v4) |
| static void | read (float &v1, float &v2, float &v3, float &v4, float &v5) |
| static void | read (uint8_t *bytes, unsigned int len) |
| user-XML mode: the raw cddf1003 value | |
| static float | readChannel (int channel) |
| any input channel | |
| static bool | changed (int channel) |
| true once per new value | |
| static void | onChange (int channel, phyphox::ChangeCallback) |
| Attach a callback to an input channel after the experiment was added (the element's onChange() does the same before). | |
| static void | onPress (int channel, phyphox::PressCallback) |
| static const phyphox::ExperimentEvent & | lastEvent () |
| static void | setMTU (uint16_t payload) |
| Ask for an MTU payload up to 512 bytes (default 20). | |
| static void | printXML (Print *out) |
| the document as the phone receives it | |
| static void | printErrors (Print *out) |
| configuration errors, if any | |
| static const phyphox::ServerStats & | stats () |
| static const char * | version () |
| static const char * | transportName () |
| static void | begin (Print *debugOut) |
| 1.x: route debug output here (compiles now) | |
| static phyphox::Server & | server () |
Static Public Attributes | |
| static void(* | configHandler )() |
| 1.x hook: called after any value arrived from the phone (any channel, any sensor). | |
| static void(* | experimentEventHandler )() |
| static uint8_t | eventType |
| phyphox::EventType of the last event | |
| static int64_t | experimentTime |
| ms since the experiment was started (−1 on SYNC) | |
| static int64_t | systemTime |
| Unix time in ms as the phone sees it. | |
| static uint16_t | minConInterval |
| Connection parameters in BLE units (1.25 ms, 1.25 ms, events, 10 ms). | |
| static uint16_t | maxConInterval |
| static uint16_t | slaveLatency |
| static uint16_t | timeout |
| static uint16_t | currentConnections |
| 1.x field, kept up to date | |
| static bool | isSubscribed |
| the phone subscribed to the data characteristic | |
Static façade over one phyphox::Server.
Every method is a one-liner forwarding to it; the class exists so that PhyphoxBLE::start() and PhyphoxBLE::write(x) stay the whole story for the simplest sketches.
|
static |
Serve this description (copies it). May be called before or after start().
|
static |
1.x: route debug output here (compiles now)
|
static |
true once per new value
|
static |
|
static |
Attach a callback to an input channel after the experiment was added (the element's onChange() does the same before).
|
static |
|
static |
Gives the BLE stack CPU time and drives the transfer.
Required on every board; a no-op where the stack runs by itself (ESP32), so calling it never hurts.
|
static |
1.x signature; the timeout is ignored
|
static |
configuration errors, if any
|
static |
the document as the phone receives it
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
user-XML mode: the raw cddf1003 value
|
static |
any input channel
|
static |
|
static |
Ask for an MTU payload up to 512 bytes (default 20).
Emits the mtu attribute; the phone negotiates what it can (iOS always the maximum). Bandwidth path with the array write.
|
static |
Start and serve experiment in one call.
|
static |
Serve a hand-written phyphox document instead of a generated one (1.x form).
|
static |
Advertise as deviceName ("phyphox-Arduino" by default).
Without addExperiment() the default experiment is served: a graph of channel 1 over time plus its value.
|
inlinestatic |
|
static |
|
static |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Raw arrays, up to the MTU payload; with setRepeating(n) the app unpacks n samples.
|
static |
1.x hook: called after any value arrived from the phone (any channel, any sensor).
|
static |
1.x field, kept up to date
|
static |
phyphox::EventType of the last event
|
static |
|
static |
ms since the experiment was started (−1 on SYNC)
|
static |
the phone subscribed to the data characteristic
|
static |
|
static |
Connection parameters in BLE units (1.25 ms, 1.25 ms, events, 10 ms).
Defaults are Apple-compliant (15–30 ms); a request iOS cannot accept is ignored by iOS.
|
static |
|
static |
Unix time in ms as the phone sees it.
|
static |