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

#include <ChannelStore.h>

Public Member Functions

void attach (uint8_t channels, void *storage)
 Size for channels 1 … channels (storage comes from the experiment block).
 
void clear ()
 
void setDefault (uint8_t channel, float value)
 Pre-fill a channel with the element's default so read() returns it before any change.
 
void setCallbacks (uint8_t channel, ChangeCallback onChange, PressCallback onPress)
 
void deliver (uint8_t channel, float value)
 A value arrived from the phone. Stores it, bumps the counter, fires the callbacks.
 
float value (uint8_t channel) const
 
uint32_t updates (uint8_t channel) const
 How many deliveries the channel has seen since start (lets a sketch poll for changes).
 
bool changed (uint8_t channel)
 True once per delivery: returns whether a value arrived since the last call.
 

Static Public Member Functions

static size_t bytesNeeded (uint8_t channels)
 

Member Function Documentation

◆ attach()

void phyphox::ChannelStore::attach ( uint8_t  channels,
void *  storage 
)

Size for channels 1 … channels (storage comes from the experiment block).

◆ bytesNeeded()

static size_t phyphox::ChannelStore::bytesNeeded ( uint8_t  channels)
static

◆ changed()

bool phyphox::ChannelStore::changed ( uint8_t  channel)

True once per delivery: returns whether a value arrived since the last call.

◆ clear()

void phyphox::ChannelStore::clear ( )

◆ deliver()

void phyphox::ChannelStore::deliver ( uint8_t  channel,
float  value 
)

A value arrived from the phone. Stores it, bumps the counter, fires the callbacks.

◆ setCallbacks()

void phyphox::ChannelStore::setCallbacks ( uint8_t  channel,
ChangeCallback  onChange,
PressCallback  onPress 
)

◆ setDefault()

void phyphox::ChannelStore::setDefault ( uint8_t  channel,
float  value 
)

Pre-fill a channel with the element's default so read() returns it before any change.

◆ updates()

uint32_t phyphox::ChannelStore::updates ( uint8_t  channel) const

How many deliveries the channel has seen since start (lets a sketch poll for changes).

◆ value()

float phyphox::ChannelStore::value ( uint8_t  channel) const

The documentation for this class was generated from the following file: