21#define SENSOR_ACCELEROMETER "accelerometer"
22#define SENSOR_ACCELEROMETER_WITHOUT_G "linear_acceleration"
23#define SENSOR_LINEAR_ACCELERATION "linear_acceleration"
24#define SENSOR_GRAVITY "gravity"
25#define SENSOR_GYROSCOPE "gyroscope"
26#define SENSOR_MAGNETIC_FIELD "magnetic_field"
27#define SENSOR_PRESSURE "pressure"
28#define SENSOR_LIGHT "light"
29#define SENSOR_PROXIMITY "proximity"
30#define SENSOR_TEMPERATURE "temperature"
31#define SENSOR_HUMIDITY "humidity"
32#define SENSOR_ATTITUDE "attitude"
35#define SENSOR_CUSTOM "custom"
38#define SENSOR_MAGNETOMETER SENSOR_MAGNETIC_FIELD
41#define COLOR_RED "fe005d"
42#define COLOR_BLUE "39a2ff"
43#define COLOR_GREEN "2bfb4c"
44#define COLOR_ORANGE "ff7e22"
45#define COLOR_WHITE "ffffff"
46#define COLOR_YELLOW "edf668"
47#define COLOR_MAGENTA "eb46f4"
51#if defined(PHYPHOX_BLE_USE_ESP32)
53 #define PHYPHOX_BLE_TRANSPORT phyphox::Esp32CoreBleTransport
54#elif defined(PHYPHOX_BLE_USE_ESP32_BLE4)
56 #define PHYPHOX_BLE_TRANSPORT phyphox::Esp32Ble4Transport
57#elif defined(PHYPHOX_BLE_USE_NINAB31)
59 #define PHYPHOX_BLE_TRANSPORT phyphox::NinaB31Transport
60#elif defined(PHYPHOX_BLE_USE_ARDUINOBLE)
62 #define PHYPHOX_BLE_TRANSPORT phyphox::ArduinoBleTransport
75 static void start(
const char* deviceName =
"phyphox-Arduino");
79 static void start(
const char* deviceName, uint8_t* xml,
size_t len);
80 static void start(uint8_t* xml,
size_t len) {
start(
"phyphox-Arduino", xml, len); }
88 static void poll(
int timeoutMs);
92 static void write(
const float& v1);
93 static void write(
const float& v1,
const float& v2);
94 static void write(
const float& v1,
const float& v2,
const float& v3);
95 static void write(
const float& v1,
const float& v2,
const float& v3,
const float& v4);
96 static void write(
const float& v1,
const float& v2,
const float& v3,
const float& v4,
const float& v5);
98 static void write(uint8_t* bytes,
unsigned int len);
99 static void write(
float* values,
unsigned int count);
103 static void read(
float& v1,
float& v2);
104 static void read(
float& v1,
float& v2,
float& v3);
105 static void read(
float& v1,
float& v2,
float& v3,
float& v4);
106 static void read(
float& v1,
float& v2,
float& v3,
float& v4,
float& v5);
107 static void read(uint8_t* bytes,
unsigned int len);
#define PHYPHOX_BLE_VERSION
Library version as reported by PhyphoxBLE::version(). Must match library.properties.
Definition Config.h:20
Static façade over one phyphox::Server.
Definition phyphoxBle.h:70
static float readChannel(int channel)
any input channel
static void addExperiment(PhyphoxBleExperiment &experiment)
Serve this description (copies it). May be called before or after start().
static const char * version()
Definition phyphoxBle.h:138
static phyphox::Server & server()
static void write(const float &v1, const float &v2, const float &v3, const float &v4, const float &v5)
static void read(float &v1, float &v2)
static void write(const float &v1, const float &v2, const float &v3)
static uint16_t timeout
Definition phyphoxBle.h:130
static bool changed(int channel)
true once per new value
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 write(const float &v1, const float &v2, const float &v3, const float &v4)
static void read(float &v1, float &v2, float &v3)
static void start(uint8_t *xml, size_t len)
Definition phyphoxBle.h:80
static const phyphox::ServerStats & stats()
static void read(float &v1, float &v2, float &v3, float &v4, float &v5)
static void printErrors(Print *out)
configuration errors, if any
static uint8_t eventType
phyphox::EventType of the last event
Definition phyphoxBle.h:119
static bool isSubscribed
the phone subscribed to the data characteristic
Definition phyphoxBle.h:137
static void poll()
Gives the BLE stack CPU time and drives the transfer.
static int64_t experimentTime
ms since the experiment was started (−1 on SYNC)
Definition phyphoxBle.h:120
static void read(uint8_t *bytes, unsigned int len)
user-XML mode: the raw cddf1003 value
static uint16_t minConInterval
Connection parameters in BLE units (1.25 ms, 1.25 ms, events, 10 ms).
Definition phyphoxBle.h:130
static void poll(int timeoutMs)
1.x signature; the timeout is ignored
static void write(const float &v1)
static void onPress(int channel, phyphox::PressCallback)
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(* configHandler)()
1.x hook: called after any value arrived from the phone (any channel, any sensor).
Definition phyphoxBle.h:115
static void write(const float &v1, const float &v2)
static void printXML(Print *out)
the document as the phone receives it
static const phyphox::ExperimentEvent & lastEvent()
static void setMTU(uint16_t payload)
Ask for an MTU payload up to 512 bytes (default 20).
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 read(float &v1)
static void write(float *values, unsigned int count)
static void read(float &v1, float &v2, float &v3, float &v4)
static int64_t systemTime
Unix time in ms as the phone sees it.
Definition phyphoxBle.h:121
static void(* experimentEventHandler)()
Definition phyphoxBle.h:118
static const char * transportName()
static uint16_t currentConnections
1.x field, kept up to date
Definition phyphoxBle.h:136
static uint16_t maxConInterval
Definition phyphoxBle.h:130
static void begin(Print *debugOut)
1.x: route debug output here (compiles now)
static void onChange(int channel, phyphox::ChangeCallback)
Attach a callback to an input channel after the experiment was added (the element's onChange() does t...
static uint16_t slaveLatency
Definition phyphoxBle.h:130
Definition phyphoxBleExperiment.h:34
void(* ChangeCallback)(float value)
Callback types. Plain function pointers (captureless lambdas convert), never std::function.
Definition ElementData.h:19
void(* PressCallback)()
Definition ElementData.h:20
Definition ChannelStore.h:45
Statistics a bench or a curious sketch can read (PhyphoxBLE::stats()).
Definition Server.h:18