|
phyphox BLE
Plot your Arduino's data in the phyphox app and control the board from the phone
|


Go to the source code of this file.
Macros | |
| #define | PHYPHOX_BLE_FORMAT_VERSION "1.20" |
| The phyphox file-format version every generated experiment declares. | |
| #define | PHYPHOX_BLE_VERSION "2.0.0" |
| Library version as reported by PhyphoxBLE::version(). Must match library.properties. | |
| #define | PHYPHOX_BLE_DATA_CHANNELS 5 |
| Values the board streams to the phone: write(f1 … f5). | |
| #define | PHYPHOX_BLE_MAX_INPUT_CHANNEL 16 |
| Highest input channel number a sketch may use. | |
| #define | PHYPHOX_BLE_SENSOR_COMPONENTS 6 |
| Components a phone sensor can deliver: x, y, z, abs, accuracy, t — the format has six. | |
| #define | PHYPHOX_BLE_INLINE_OPTIONS 8 |
| Entries the incremental addMap()/addOption() setters keep inside the builder object before addExperiment() copies them. | |
| #define | PHYPHOX_BLE_MAX_STRING_LENGTH 250 |
| Longest string a setter accepts (label, unit, description, …). | |
| #define | PHYPHOX_BLE_DEFAULT_MTU 20 |
| Default MTU payload (ATT_MTU 23 − 3). setMTU() raises it where the transport can negotiate. | |
| #define | PHYPHOX_BLE_MAX_MTU 512 |
| #define | PHYPHOX_BLE_TRANSFER_RETRY_DELAY_MS 5 |
| Transfer flow control: a refused notification is re-sent after RETRY_DELAY_MS, the pause doubling with every consecutive refusal up to RETRY_MAX_MS. | |
| #define | PHYPHOX_BLE_TRANSFER_RETRY_MAX_MS 50 |
| #define | PHYPHOX_BLE_TRANSFER_STALL_MS 3000 |
| A transfer that has not moved (no packet accepted) for this long is abandoned, so a stuck session can never block the next trigger. | |
| #define | PHYPHOX_BLE_TRANSFER_START_DELAY_MS 150 |
| The first packet waits this long after the trigger. | |
| #define | PHYPHOX_BLE_TRANSFER_BURST 8 |
| Packets sent back to back per pump before the stack gets a breather (the ESP32 task pumps every 2 ms). | |
| #define | PHYPHOX_BLE_CORDIO_PACKET_GAP_MS 30 |
| Nano 33 BLE and Nicla Sense ME (Mbed's Cordio link layer): the minimum time between two experiment packets, so the link layer holds at most one at a time. | |
| #define | PHYPHOX_BLE_NINA_EVENT_QUEUE 8 |
| NINA-B31 transport: unsolicited module events (connect, write, read request) queued while a command waits for its response, dispatched from poll(). | |
| #define PHYPHOX_BLE_CORDIO_PACKET_GAP_MS 30 |
Nano 33 BLE and Nicla Sense ME (Mbed's Cordio link layer): the minimum time between two experiment packets, so the link layer holds at most one at a time.
With several queued it drops one now and then while reporting it sent (every 4th packet on a Nano 33 BLE). 1.x paced its transfer at the same 30 ms and never showed the loss.
| #define PHYPHOX_BLE_DATA_CHANNELS 5 |
Values the board streams to the phone: write(f1 … f5).
Fixed at 5 as in 1.x — the data characteristic carries five float32 in one 20-byte notification. More bandwidth comes from setMTU() plus the array write and setRepeating(), not from more channels (decision D12).
| #define PHYPHOX_BLE_DEFAULT_MTU 20 |
Default MTU payload (ATT_MTU 23 − 3). setMTU() raises it where the transport can negotiate.
| #define PHYPHOX_BLE_FORMAT_VERSION "1.20" |
The phyphox file-format version every generated experiment declares.
Always the latest version this library knows (decision D1 of the 2.0 plan); bumped with library releases. The conformance test checks that nothing the library emits is newer than this.
| #define PHYPHOX_BLE_INLINE_OPTIONS 8 |
Entries the incremental addMap()/addOption() setters keep inside the builder object before addExperiment() copies them.
Only a convenience limit: setOptions(n, labels, values) and setMaps(n, …) take arrays of any length.
| #define PHYPHOX_BLE_MAX_INPUT_CHANNEL 16 |
Highest input channel number a sketch may use.
Every input channel is one characteristic, and the NINA-B31 module keeps a bounded GATT table (plan §3.3), so this is a protocol cap, not a pool: only the channels actually used cost anything. 1.x allowed 5.
| #define PHYPHOX_BLE_MAX_MTU 512 |
| #define PHYPHOX_BLE_MAX_STRING_LENGTH 250 |
Longest string a setter accepts (label, unit, description, …).
Longer strings are an ERR_01 configuration error. Strings are stored by pointer, never copied — see docs/concepts.md, "Strings".
| #define PHYPHOX_BLE_NINA_EVENT_QUEUE 8 |
NINA-B31 transport: unsolicited module events (connect, write, read request) queued while a command waits for its response, dispatched from poll().
Each slot holds one line (128 bytes).
| #define PHYPHOX_BLE_SENSOR_COMPONENTS 6 |
Components a phone sensor can deliver: x, y, z, abs, accuracy, t — the format has six.
| #define PHYPHOX_BLE_TRANSFER_BURST 8 |
Packets sent back to back per pump before the stack gets a breather (the ESP32 task pumps every 2 ms).
Far faster than any link, but leaves room for the phone's writes and reads.
| #define PHYPHOX_BLE_TRANSFER_RETRY_DELAY_MS 5 |
Transfer flow control: a refused notification is re-sent after RETRY_DELAY_MS, the pause doubling with every consecutive refusal up to RETRY_MAX_MS.
There is no retry count — a congested stack can refuse for hundreds of milliseconds in a row and the packet must still go out; only the stall watchdog below abandons a transfer.
| #define PHYPHOX_BLE_TRANSFER_RETRY_MAX_MS 50 |
| #define PHYPHOX_BLE_TRANSFER_STALL_MS 3000 |
A transfer that has not moved (no packet accepted) for this long is abandoned, so a stuck session can never block the next trigger.
The app's own transfer timeout is longer.
| #define PHYPHOX_BLE_TRANSFER_START_DELAY_MS 150 |
The first packet waits this long after the trigger.
The apps subscribe and then at once write 1 to the control characteristic; a board that floods notifications the moment the subscription arrives starves the stack's response to that write, and Android abandons the transfer after 5 s with "could not write" (seen on a Pixel 9 Pro, 2026-09-13).
| #define PHYPHOX_BLE_VERSION "2.0.0" |
Library version as reported by PhyphoxBLE::version(). Must match library.properties.