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

Namespaces

namespace  nina
 

Classes

class  ArduinoBleTransport
 
class  BufferSource
 
struct  ButtonData
 
class  ByteSource
 Anything that can serve document bytes by offset: the Serializer for generated experiments, a plain buffer for user-supplied XML. More...
 
class  ChannelStore
 
struct  CharId
 
class  CountingSink
 Counts bytes and accumulates the CRC-32 — the first pass at start(), which yields the transfer header (size, CRC) and the part table. More...
 
class  Crc32
 
struct  DropdownData
 
struct  EditData
 
struct  ElementData
 One view element. label and xmlAttribute are common to all; the union holds the rest. More...
 
struct  ErrorRecord
 The first error recorded on an element, with the setter it came from. More...
 
class  Esp32Ble4Transport
 
class  Esp32CoreBleTransport
 
struct  ExperimentData
 The whole experiment. More...
 
struct  ExperimentEvent
 
class  ExperimentStore
 
struct  ExportDataData
 
struct  ExportSetData
 
struct  GattLayout
 What the core asks the transport to create at begin(). More...
 
struct  GraphData
 
struct  InfoData
 
struct  InputChannelInfo
 What the store knows about one input channel after the copy: which characteristic carries it, how the app is told to deliver it, and which element owns it. More...
 
struct  InputCommon
 Common part of every element that writes into an input channel (edit, slider, dropdown, toggle, button). More...
 
struct  MapEntry
 A value map entry (text shown while min <= value <= max) or a dropdown option (text + value). More...
 
class  NinaB31Transport
 
struct  SensorData
 
struct  SeparatorData
 
class  Serializer
 
class  Server
 
struct  ServerStats
 Statistics a bench or a curious sketch can read (PhyphoxBLE::stats()). More...
 
class  Sink
 Receives the bytes of a serialization. More...
 
struct  SliderData
 
struct  SubgraphData
 One curve of a graph. Channel 0 is the phone's arrival time, 1…5 the data channels. More...
 
struct  ToggleData
 
class  TransferSession
 
class  Transport
 
class  TransportListener
 Callbacks from the transport into the core (implemented by Server). More...
 
struct  ValueData
 
struct  ViewData
 
class  WindowSink
 Passes through only the bytes inside [skip, skip + capacity) of what is written to it, into a caller-provided buffer. More...
 

Typedefs

typedef void(* ChangeCallback) (float value)
 Callback types. Plain function pointers (captureless lambdas convert), never std::function.
 
typedef void(* PressCallback) ()
 
typedef const char * Color
 A colour is six hex digits, validated by the setter; nullptr means "not set".
 

Enumerations

enum  EventType : uint8_t { EVENT_PAUSE = 0x00 , EVENT_START = 0x01 , EVENT_CLEAR = 0x02 , EVENT_SYNC = 0xff }
 The 17-byte block phyphox writes to the event characteristic (bluetooth-low-energy.md, "Phyphox event characteristic"). More...
 
enum  ElementType : uint8_t {
  EL_NONE = 0 , EL_GRAPH , EL_VALUE , EL_EDIT ,
  EL_SLIDER , EL_DROPDOWN , EL_TOGGLE , EL_BUTTON ,
  EL_INFO , EL_SEPARATOR
}
 
enum  Style : uint8_t {
  STYLE_NONE = 0 , ST_LINES , ST_DOTS , ST_VBARS ,
  ST_HBARS , ST_MAP
}
 
enum  Layout : uint8_t { LAYOUT_NONE = 0 , LY_AUTO , LY_EXTEND , LY_FIXED }
 
enum  Align : uint8_t { ALIGN_NONE = 0 , AL_LEFT , AL_RIGHT , AL_CENTER }
 
enum  SensorComponent : uint8_t {
  COMP_NONE = 0 , COMP_X , COMP_Y , COMP_Z ,
  COMP_ABS , COMP_ACCURACY , COMP_T
}
 
enum  ErrorCode : uint8_t {
  ERR_NONE = 0 , ERR_01_TOO_LONG = 1 , ERR_02_ABOVE_LIMIT = 2 , ERR_03_NOT_HEX_COLOR = 3 ,
  ERR_04_INVALID_VALUE = 4 , ERR_05_INVALID_LAYOUT = 5 , ERR_06_CAPACITY = 6 , ERR_07_CHANNEL_CONFLICT = 7 ,
  ERR_08_NULL_STRING = 8
}
 
enum  CharKind : uint8_t {
  CH_EXPERIMENT , CH_CONTROL , CH_EVENT , CH_DATA ,
  CH_INPUT , CH_SENSOR , CH_LEGACY_CONFIG
}
 The characteristics a phyphox device exposes. More...
 

Functions

const char * errorText (ErrorCode code)
 short English description for the info element
 
void writeEscaped (Sink &, const char *text)
 Text helpers shared by the emitters (public so the host tests can pin them): XML-escape text into the sink; format a float the way the phyphox format expects (shortest round-trip-ish decimal, no exponent for the ranges sketches use, "." decimal point).
 
void writeFloat (Sink &, float v)
 
void writeInt (Sink &, int32_t v)
 
void writeInputCharUuid (Sink &, uint8_t channel)
 The UUID of the k-th input-channel / s-th sensor characteristic (docs/protocol.md).
 
void writeSensorCharUuid (Sink &, uint8_t sensor)
 

Typedef Documentation

◆ ChangeCallback

typedef void(* phyphox::ChangeCallback) (float value)

Callback types. Plain function pointers (captureless lambdas convert), never std::function.

◆ Color

typedef const char* phyphox::Color

A colour is six hex digits, validated by the setter; nullptr means "not set".

◆ PressCallback

typedef void(* phyphox::PressCallback) ()

Enumeration Type Documentation

◆ Align

enum phyphox::Align : uint8_t
Enumerator
ALIGN_NONE 
AL_LEFT 
AL_RIGHT 
AL_CENTER 

◆ CharKind

enum phyphox::CharKind : uint8_t

The characteristics a phyphox device exposes.

Fixed UUIDs (contract, ../CLAUDE.md): EXPERIMENT cddf0002, CONTROL cddf0003, EVENT cddf0004 in the experiment service cddf0001. Library conventions (docs/protocol.md): DATA cddf1002 in the data service cddf1001; INPUT k at cddf20kk, SENSOR s at cddf30ss; LEGACY_CONFIG cddf1003 only in user-XML mode.

Enumerator
CH_EXPERIMENT 
CH_CONTROL 
CH_EVENT 
CH_DATA 
CH_INPUT 
CH_SENSOR 
CH_LEGACY_CONFIG 

◆ ElementType

enum phyphox::ElementType : uint8_t
Enumerator
EL_NONE 
EL_GRAPH 
EL_VALUE 
EL_EDIT 
EL_SLIDER 
EL_DROPDOWN 
EL_TOGGLE 
EL_BUTTON 
EL_INFO 
EL_SEPARATOR 

◆ ErrorCode

enum phyphox::ErrorCode : uint8_t
Enumerator
ERR_NONE 
ERR_01_TOO_LONG 

a string exceeds PHYPHOX_BLE_MAX_STRING_LENGTH

ERR_02_ABOVE_LIMIT 

a number exceeds its upper limit (channel, rate, count)

ERR_03_NOT_HEX_COLOR 

a colour is not six hexadecimal digits

ERR_04_INVALID_VALUE 

a style, component, sensor type or option is not one the format has

ERR_05_INVALID_LAYOUT 

a layout is not auto, extend or fixed

ERR_06_CAPACITY 

the experiment block could not be allocated, or an inline addMap/addOption limit was hit

ERR_07_CHANNEL_CONFLICT 

a button shares an input channel with another element

ERR_08_NULL_STRING 

a null pointer was passed where a string is required

◆ EventType

enum phyphox::EventType : uint8_t

The 17-byte block phyphox writes to the event characteristic (bluetooth-low-energy.md, "Phyphox event characteristic").

Enumerator
EVENT_PAUSE 
EVENT_START 
EVENT_CLEAR 
EVENT_SYNC 

◆ Layout

enum phyphox::Layout : uint8_t
Enumerator
LAYOUT_NONE 
LY_AUTO 
LY_EXTEND 
LY_FIXED 

◆ SensorComponent

enum phyphox::SensorComponent : uint8_t
Enumerator
COMP_NONE 
COMP_X 
COMP_Y 
COMP_Z 
COMP_ABS 
COMP_ACCURACY 
COMP_T 

◆ Style

enum phyphox::Style : uint8_t
Enumerator
STYLE_NONE 
ST_LINES 
ST_DOTS 
ST_VBARS 
ST_HBARS 
ST_MAP 

Function Documentation

◆ errorText()

const char * phyphox::errorText ( ErrorCode  code)

short English description for the info element

◆ writeEscaped()

void phyphox::writeEscaped ( Sink &  ,
const char *  text 
)

Text helpers shared by the emitters (public so the host tests can pin them): XML-escape text into the sink; format a float the way the phyphox format expects (shortest round-trip-ish decimal, no exponent for the ranges sketches use, "." decimal point).

◆ writeFloat()

void phyphox::writeFloat ( Sink &  ,
float  v 
)

◆ writeInputCharUuid()

void phyphox::writeInputCharUuid ( Sink &  ,
uint8_t  channel 
)

The UUID of the k-th input-channel / s-th sensor characteristic (docs/protocol.md).

◆ writeInt()

void phyphox::writeInt ( Sink &  ,
int32_t  v 
)

◆ writeSensorCharUuid()

void phyphox::writeSensorCharUuid ( Sink &  ,
uint8_t  sensor 
)