MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Functions
datasignal.h File Reference

Functions for controlling a MblMwDataSignal. More...

#include "data.h"
#include "datasignal_fwd.h"
#include "logging_fwd.h"
#include "metawear/platform/dllmarker.h"

Go to the source code of this file.

Functions

METAWEAR_API MblMwDataSignalmbl_mw_datasignal_get_component (const MblMwDataSignal *signal, uint8_t index)
 Retrieves an individual value from a multi-valued datasignal i.e. More...
 
METAWEAR_API void mbl_mw_datasignal_subscribe (MblMwDataSignal *signal, void *context, MblMwFnData received_data)
 Subscribes to a data stream, processing messages with the given handler. More...
 
METAWEAR_API void mbl_mw_datasignal_unsubscribe (MblMwDataSignal *signal)
 Unsubscribes from a data stream. More...
 
METAWEAR_API int32_t mbl_mw_datasignal_is_readable (const MblMwDataSignal *signal)
 Check if the data signal can be explicitly read. More...
 
METAWEAR_API void mbl_mw_datasignal_read (const MblMwDataSignal *signal)
 Reads data from sensor represented by the data signal. More...
 
METAWEAR_API void mbl_mw_datasignal_read_with_parameters (const MblMwDataSignal *signal, const void *parameters)
 Reads data from sensor represented by the data signal. More...
 
METAWEAR_API void mbl_mw_datasignal_log (MblMwDataSignal *signal, void *context, MblMwFnDataLoggerPtr logger_ready)
 Creates an MblMwDataLogger for the signal. More...
 

Detailed Description

Functions for controlling a MblMwDataSignal.

Function Documentation

◆ mbl_mw_datasignal_get_component()

METAWEAR_API MblMwDataSignal* mbl_mw_datasignal_get_component ( const MblMwDataSignal signal,
uint8_t  index 
)

Retrieves an individual value from a multi-valued datasignal i.e.

MblMwCartesianFloat datasignal is 3 float values.
These individual signals can use the full suite of

Parameters
signalData signal to lookup
indexIndex of the component to return
Returns
Signal component, null if signal is signle valued

◆ mbl_mw_datasignal_is_readable()

METAWEAR_API int32_t mbl_mw_datasignal_is_readable ( const MblMwDataSignal signal)

Check if the data signal can be explicitly read.

Parameters
signalData signal to check
Returns
Zero if not readable, non-zero if it is

◆ mbl_mw_datasignal_log()

METAWEAR_API void mbl_mw_datasignal_log ( MblMwDataSignal signal,
void *  context,
MblMwFnDataLoggerPtr  logger_ready 
)

Creates an MblMwDataLogger for the signal.

Parameters
signalData signal to log
contextPointer to additional data for the callback function
logger_readyCallback function to be executed when the logger is created

◆ mbl_mw_datasignal_read()

METAWEAR_API void mbl_mw_datasignal_read ( const MblMwDataSignal signal)

Reads data from sensor represented by the data signal.

Data is forwarded to the callback function assigned by the mbl_mw_datasignal_subscribe function

Parameters
signalData signal to read from

◆ mbl_mw_datasignal_read_with_parameters()

METAWEAR_API void mbl_mw_datasignal_read_with_parameters ( const MblMwDataSignal signal,
const void *  parameters 
)

Reads data from sensor represented by the data signal.

Data is forwarded to the callback function assigned by the mbl_mw_datasignal_subscribe function. This variant is for reads that require additional parameters.

Parameters
signalData signal to read from
parametersAdditional parameters required for the read operation

◆ mbl_mw_datasignal_subscribe()

METAWEAR_API void mbl_mw_datasignal_subscribe ( MblMwDataSignal signal,
void *  context,
MblMwFnData  received_data 
)

Subscribes to a data stream, processing messages with the given handler.

Parameters
signalData signal to subscribe to
contextPointer to additional data for the callback function
received_dataCallback function to handle data received from the signal

◆ mbl_mw_datasignal_unsubscribe()

METAWEAR_API void mbl_mw_datasignal_unsubscribe ( MblMwDataSignal signal)

Unsubscribes from a data stream.

Parameters
signalData signal to unsubscribe from