MetaWear C++ API
0.18.0
C++ implementation of the MetaWear protocol
|
Only allows data through that satisfies a comparison operation. More...
#include "processor_common.h"
Go to the source code of this file.
Enumerations | |
enum | MblMwComparatorOperation { MBL_MW_COMPARATOR_OP_EQ = 0, MBL_MW_COMPARATOR_OP_NEQ, MBL_MW_COMPARATOR_OP_LT, MBL_MW_COMPARATOR_OP_LTE, MBL_MW_COMPARATOR_OP_GT, MBL_MW_COMPARATOR_OP_GTE } |
Available operations for the processor. More... | |
enum | MblMwComparatorMode { MBL_MW_COMPARATOR_MODE_ABSOLUTE = 0, MBL_MW_COMPARATOR_MODE_REFERENCE, MBL_MW_COMPARATOR_MODE_ZONE, MBL_MW_COMPARATOR_MODE_BINARY } |
Output modes for the comparator, only supported in firmware v1.2.3 and higher. More... | |
Functions | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_comparator_create (MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created) |
Create a comparator processor where signed/unsigned is inferred. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_comparator_create_signed (MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created) |
Create a comparator processor specifically for a signed comparison. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_comparator_create_unsigned (MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created) |
Create a comparator processor specifically for an unsigned comparison. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_comparator_modify (MblMwDataProcessor *comparator, MblMwComparatorOperation op, float reference) |
Modifies the comparator processor, changing the operation and reference value. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_comparator_modify_signal (MblMwDataProcessor *comparator, MblMwComparatorOperation op, MblMwDataSignal *reference_signal) |
Modifies the comparator processor for a feedback or feedforward loop. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_multi_comparator_create (MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created) |
Create a multi-value comparator where a signed/unsigned comparison is inferred. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_multi_comparator_create_signed (MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created) |
Create a multi-value comparator for signed comparisons. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_multi_comparator_create_unsigned (MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created) |
Create a multi-value comparator for unsigned comparisons. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_multi_comparator_modify (MblMwDataProcessor *comparator, MblMwComparatorOperation op, float references[], uint8_t references_length) |
Modifies the multi-value comparator, changing the operation and reference values. More... | |
Only allows data through that satisfies a comparison operation.
enum MblMwComparatorMode |
Output modes for the comparator, only supported in firmware v1.2.3 and higher.
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_create | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
float | reference, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a comparator processor where signed/unsigned is inferred.
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 |
op | Comparison operation to execute |
reference | Reference value to compare the input to |
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_comparator_create_signed | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
float | reference, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a comparator processor specifically for a signed comparison.
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 |
op | Comparison operation to execute |
reference | Reference value to compare the input to |
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_comparator_create_unsigned | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
float | reference, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a comparator processor specifically for an unsigned comparison.
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 |
op | Comparison operation to execute |
reference | Reference value to compare the input to |
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_comparator_modify | ( | MblMwDataProcessor * | comparator, |
MblMwComparatorOperation | op, | ||
float | reference | ||
) |
Modifies the comparator processor, changing the operation and reference value.
comparator | Comparator processor to modify |
op | New comparison operation |
reference | New reference value |
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_modify_signal | ( | MblMwDataProcessor * | comparator, |
MblMwComparatorOperation | op, | ||
MblMwDataSignal * | reference_signal | ||
) |
Modifies the comparator processor for a feedback or feedforward loop.
comparator | Comparator processor to modify |
op | New comparison operation |
reference_signal | Data signal output to be used for the reference value |
METAWEAR_API int32_t mbl_mw_dataprocessor_multi_comparator_create | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
MblMwComparatorMode | mode, | ||
float | references[], | ||
uint8_t | references_length, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a multi-value comparator where a signed/unsigned comparison is inferred.
This feature is only available on firmware v1.2.3 and later.
A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input |
op | Comparison operation to execute |
mode | Processor output mode |
references | Array of reference values to compare against |
references_length | Number of elements in the references array |
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_multi_comparator_create_signed | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
MblMwComparatorMode | mode, | ||
float | references[], | ||
uint8_t | references_length, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a multi-value comparator for signed comparisons.
This feature is only available on firmware v1.2.3 and later. A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input |
op | Comparison operation to execute |
mode | Processor output mode |
references | Array of reference values to compare against |
references_length | Number of elements in the references array |
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_multi_comparator_create_unsigned | ( | MblMwDataSignal * | source, |
MblMwComparatorOperation | op, | ||
MblMwComparatorMode | mode, | ||
float | references[], | ||
uint8_t | references_length, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a multi-value comparator for unsigned comparisons.
This feature is only available on firmware v1.2.3 and later. A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input |
op | Comparison operation to execute |
mode | Processor output mode |
references | Array of reference values to compare against |
references_length | Number of elements in the references array |
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_multi_comparator_modify | ( | MblMwDataProcessor * | comparator, |
MblMwComparatorOperation | op, | ||
float | references[], | ||
uint8_t | references_length | ||
) |
Modifies the multi-value comparator, changing the operation and reference values.
This feature is only available on firmware v1.2.3 and later.
comparator | Comparator processor to modify |
op | New comparison operation |
references | Array of new reference values |
references_length | Number of elements in the references array |