MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Enumerations | Functions
passthrough.h File Reference

Gate that only allows data though based on a user configured internal state. More...

#include "processor_common.h"

Go to the source code of this file.

Enumerations

enum  MblMwPassthroughMode { MBL_MW_PASSTHROUGH_MODE_ALL = 0, MBL_MW_PASSTHROUGH_MODE_CONDITIONAL, MBL_MW_PASSTHROUGH_MODE_COUNT }
 Operation modes for the processor. More...
 

Functions

METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_create (MblMwDataSignal *source, MblMwPassthroughMode mode, uint16_t count, void *context, MblMwFnDataProcessor processor_created)
 Create a passthrough processor. More...
 
METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_set_count (MblMwDataProcessor *passthrough, uint16_t new_count)
 Modify the internal count of the passthrough processor. More...
 
METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_modify (MblMwDataProcessor *passthrough, MblMwPassthroughMode mode, uint16_t count)
 Modify the passthrough configuration. More...
 

Detailed Description

Gate that only allows data though based on a user configured internal state.

Enumeration Type Documentation

◆ MblMwPassthroughMode

Operation modes for the processor.

Enumerator
MBL_MW_PASSTHROUGH_MODE_ALL 

Allow all data through.

MBL_MW_PASSTHROUGH_MODE_CONDITIONAL 

Only allow data through if count > 0.

MBL_MW_PASSTHROUGH_MODE_COUNT 

Only allow a fixed number of data samples through.

Function Documentation

◆ mbl_mw_dataprocessor_passthrough_create()

METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_create ( MblMwDataSignal source,
MblMwPassthroughMode  mode,
uint16_t  count,
void *  context,
MblMwFnDataProcessor  processor_created 
)

Create a passthrough processor.

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
modeProcessor's operation mode
countInternal count to initial the processor with
contextPointer to additional data for the callback function
processor_createdCallback function to be executed when the processor is created

◆ mbl_mw_dataprocessor_passthrough_modify()

METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_modify ( MblMwDataProcessor passthrough,
MblMwPassthroughMode  mode,
uint16_t  count 
)

Modify the passthrough configuration.

Parameters
passthroughPassthrough processor to update
modeNew operation mode to use
countNew initial count
Returns
MBL_MW_STATUS_OK if processor configuration was updated, MBL_MW_STATUS_WARNING_INVALID_PROCESSOR_TYPE if a non-passthrough processor was passed in

◆ mbl_mw_dataprocessor_passthrough_set_count()

METAWEAR_API int32_t mbl_mw_dataprocessor_passthrough_set_count ( MblMwDataProcessor passthrough,
uint16_t  new_count 
)

Modify the internal count of the passthrough processor.

Parameters
passthroughPassthrough processor to modify
new_countNew internal count
Returns
MBL_MW_STATUS_OK if processor state was updated, MBL_MW_STATUS_WARNING_INVALID_PROCESSOR_TYPE if a non-passthrough processor was passed in