|
MetaWear C++ API
0.20.0
C++ implementation of the MetaWear protocol
|
Tallies a running sum of the input. More...
#include "processor_common.h"Go to the source code of this file.
Functions | |
| METAWEAR_API int32_t | mbl_mw_dataprocessor_accumulator_create (MblMwDataSignal *source, void *context, MblMwFnDataProcessor processor_created) |
| Create an accumulator whose output is the same size as the input. More... | |
| METAWEAR_API int32_t | mbl_mw_dataprocessor_accumulator_create_size (MblMwDataSignal *source, uint8_t output_size, void *context, MblMwFnDataProcessor processor_created) |
| Create an accumulator with a specific output size. More... | |
| METAWEAR_API int32_t | mbl_mw_dataprocessor_set_accumulator_state (MblMwDataProcessor *accumulator, float new_running_sum) |
| Overwrites the current accumulator value with a new value Can be used to reset the running sum. More... | |
Tallies a running sum of the input.
| METAWEAR_API int32_t mbl_mw_dataprocessor_accumulator_create | ( | MblMwDataSignal * | source, |
| void * | context, | ||
| MblMwFnDataProcessor | processor_created | ||
| ) |
Create an accumulator whose output is the same size as the input.
Keeps a running sum of the input A pointer representing the processor will be passed back to the user via a callback function.
| source | Data signal providing the input for the processor |
| context | Pointer to additional data for the callback function |
| processor_created | Callback function to be executed when the processor is created |
| METAWEAR_API int32_t mbl_mw_dataprocessor_accumulator_create_size | ( | MblMwDataSignal * | source, |
| uint8_t | output_size, | ||
| void * | context, | ||
| MblMwFnDataProcessor | processor_created | ||
| ) |
Create an accumulator with a specific output size.
Keeps a running sum of the input and returns the output as the specified size A pointer representing the processor will be passed back to the user via a callback function.
| source | Data signal providing the input for the processor |
| output_size | Output size, between [1, 4] bytes |
| context | Pointer to additional data for the callback function |
| processor_created | Callback function to be executed when the processor is created |
| METAWEAR_API int32_t mbl_mw_dataprocessor_set_accumulator_state | ( | MblMwDataProcessor * | accumulator, |
| float | new_running_sum | ||
| ) |
Overwrites the current accumulator value with a new value Can be used to reset the running sum.
| accumulator | Accumulator processor to modify |
| new_running_sum | New running sum of the accumulator |