MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
time.h File Reference

Periodically allow data through. More...

#include "processor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwTimeMode { MBL_MW_TIME_ABSOLUTE = 0 , MBL_MW_TIME_DIFFERENTIAL }
 Output modes for the processor. More...
 

Functions

METAWEAR_API int32_t mbl_mw_dataprocessor_time_create (MblMwDataSignal *source, MblMwTimeMode mode, uint32_t period, void *context, MblMwFnDataProcessor processor_created)
 Creates a time delay processor. More...
 
METAWEAR_API int32_t mbl_mw_dataprocessor_time_modify_period (MblMwDataProcessor *time_delay, uint32_t period)
 Modify the configuration of the time delay processor. More...
 

Detailed Description

Periodically allow data through.

Enumeration Type Documentation

◆ MblMwTimeMode

Output modes for the processor.

Enumerator
MBL_MW_TIME_ABSOLUTE 

Returns the data as is.

MBL_MW_TIME_DIFFERENTIAL 

Returns the difference between the current and previous value.

Function Documentation

◆ mbl_mw_dataprocessor_time_create()

METAWEAR_API int32_t mbl_mw_dataprocessor_time_create ( MblMwDataSignal source,
MblMwTimeMode  mode,
uint32_t  period,
void *  context,
MblMwFnDataProcessor  processor_created 
)

Creates a time delay processor.


Can be used to periodically allow data through. Can be used to slowly (low freq/sampling rate) get data from sensors (i.e count to 30 and take a temp reading) A pointer representing the processor will be passed back to the user via a callback function.

Parameters
sourceData signal providing the input for the processor
modeOperation mode of the processor
periodHow often to allow data through, in milliseconds
contextPointer to additional data for the callback function
processor_createdCallback function to be executed when the processor is created

◆ mbl_mw_dataprocessor_time_modify_period()

METAWEAR_API int32_t mbl_mw_dataprocessor_time_modify_period ( MblMwDataProcessor time_delay,
uint32_t  period 
)

Modify the configuration of the time delay processor.

Parameters
time_delayTime delay processor to modify
periodHow often to allow data through, in milliseconds