MetaWear C# SDK  1.2.0
C# API for MbientLab's sensor platform
Public Member Functions | List of all members
MbientLab.MetaWear.Builder.IRouteComponent Interface Reference

Component in a route definition More...

Public Member Functions

IRouteMulticast Multicast ()
 Creates a branch in the route that direct the input data to different end points More...
 
IRouteComponent To ()
 Signals the creation of a new multicast branch More...
 
IRouteSplit Split ()
 Separates multi-component data into its individual values More...
 
IRouteComponent Index (int i)
 Gets a specific component value from the split data value More...
 
IRouteComponent Stream (Action< IData > handler)
 Streams the input data to the local device. This component is represented by the ISubscriber interface. More...
 
IRouteComponent Stream ()
 Variant of Stream(Action<IData>) that enables a data stream but does not yet assign a data handler.
The handler can be later attached with ISubscriber.Attach(Action<IData>) More...
 
IRouteComponent Log (Action< IData > handler)
 Records the input data to the on-board logger, retrieved later when a log download is started. This component is represented by the ISubscriber interface. More...
 
IRouteComponent Log ()
 Variant of Log(Action<IData>) that sets up the logger but does not yet assign a data handler.
The handler can be later attached with ISubscriber.Attach(Action<IData>) More...
 
IRouteComponent React (Action< IDataToken > action)
 Programs the board to react in response to data being created by the most resent sensor or processor More...
 
IRouteComponent Name (string name)
 Assigns a user-defined name identifying a processor, producer, or subscriber. The name can be used to create feedback and feedforward loops, or refere to subscribers by name rather than index. More...
 
IRouteComponent Accumulate ()
 Accumulates a running sum of all data samples passing through this component and outputs the current tally More...
 
IRouteComponent Count ()
 Counts the number of data samples that have passed through this component and outputs the current count More...
 
IRouteBranchEnd Buffer ()
 Stores the input data in memory which can be extracted by reading the buffer state. As this buffer does not have an output, the route cannot continue so it must either end or control is passed back to the most recent split or multicast More...
 
IRouteComponent Delay (byte samples)
 Stops data from passing until at least N samples have been collected. More...
 
IRouteComponent Average (byte samples)
 Computes a moving average over the previous N samples. This component will not output data until the first average i.e. until N samples have been received. More...
 
IRouteComponent HighPass (byte samples)
 Applies a high pass filter over the input data, available on firmware v1.3.4 and later. More...
 
IRouteComponent LowPass (byte samples)
 Applies a low pass filter over the input data, available on firmware v1.3.4 and later.
More...
 
IRouteComponent Filter (Comparison op, params float[] references)
 Remove data from the route that does not satisfy the comparison More...
 
IRouteComponent Filter (Comparison op, ComparisonOutput output, params float[] references)
 Variant of Filter(Comparison, float[]) where the filter output provides additional details about the comparison. This variant component is only supported starting with firmware v1.2.5. Note that if ComparisonOutput.Reference or ComparisonOutput.Zone is used, component will instead function as a More...
 
IRouteComponent Filter (Comparison op, params string[] names)
 Variant of the Filter(Comparison, float[]) function where the reference values are outputs from other sensors or processors More...
 
IRouteComponent Filter (Comparison op, ComparisonOutput output, params string[] names)
 Variant of Filter(Comparison, ComparisonOutput, float[]) where reference values are outputs from other sensors or processors. More...
 
IRouteComponent Find (Pulse pulse, float threshold, ushort samples)
 Scans the input data for a pulse. When one is detected, output a summary of the scanned data More...
 
IRouteComponent Find (Threshold threshold, float boundary)
 Scans the input data for values that cross a boundary, either falling below or rising above More...
 
IRouteComponent Find (Threshold threshold, float boundary, float hysteresis)
 Variant of Find(Threshold, float) with a configurable hysteresis value for data that frequently oscillates around the threshold boundary More...
 
IRouteComponent Find (Differential differential, float distance)
 Scans the input data for sequential data that is a minimum distance away More...
 
IRouteComponent Limit (Passthrough type, ushort value)
 Only allow data through under certain user controlled conditions More...
 
IRouteComponent Limit (uint period)
 Reduce the amount of data allowed through such that the output data rate matches the delay More...
 
IRouteComponent Map (Function1 fn)
 Apply a 1 input function to all of the input data More...
 
IRouteComponent Map (Function2 fn, float rhs)
 Apply a 2 input function to all of the input data More...
 
IRouteComponent Map (Function2 fn, params string[] names)
 Variant of Map(Function2, float) where the rhs value is the output of another data producer More...
 
IRouteComponent Account ()
 Variant of Account(AccountType) that defaults to recalculating timestamps More...
 
IRouteComponent Account (AccountType type)
 Add additional information to the payload to assist in checking if streamed data is lost More...
 
IRouteComponent Pack (byte count)
 Packs multiple input values into 1 BTLE packet. Used to reduce the number of packets broadcasted over the link. More...
 
IRouteComponent Fuse (params string[] bufferNames)
 Combines data from multiple sources into 1 packet, available on firmware v1.4.4+.
The additional data you want to combine must first be stored into a named buffer. More...
 

Detailed Description

Component in a route definition

Member Function Documentation

◆ Account() [1/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Account ( )

Variant of Account(AccountType) that defaults to recalculating timestamps

Returns
Component representing the accounter output

◆ Account() [2/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Account ( AccountType  type)

Add additional information to the payload to assist in checking if streamed data is lost

Parameters
typeType of information to append to the data
Returns
Component representing the accounter output

◆ Accumulate()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Accumulate ( )

Accumulates a running sum of all data samples passing through this component and outputs the current tally

Returns
Component representing the accumulated sum

◆ Average()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Average ( byte  samples)

Computes a moving average over the previous N samples. This component will not output data until the first average i.e. until N samples have been received.

Parameters
samplesNumber of samples to average over
Returns
Component representing the running averager

◆ Buffer()

IRouteBranchEnd MbientLab.MetaWear.Builder.IRouteComponent.Buffer ( )

Stores the input data in memory which can be extracted by reading the buffer state. As this buffer does not have an output, the route cannot continue so it must either end or control is passed back to the most recent split or multicast

Returns
Object for continuing the route

◆ Count()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Count ( )

Counts the number of data samples that have passed through this component and outputs the current count

Returns
Component representing the counter output

◆ Delay()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Delay ( byte  samples)

Stops data from passing until at least N samples have been collected.

Parameters
samplesNumber of samples to collect
Returns
Component representing the delayed output

◆ Filter() [1/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Filter ( Comparison  op,
params float []  references 
)

Remove data from the route that does not satisfy the comparison

Parameters
opComparison operation to perform
referencesReference values to compare against, can be multiple values if the board is on firmware v1.2.3 or later
Returns
Component representing the filter output

◆ Filter() [2/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Filter ( Comparison  op,
ComparisonOutput  output,
params float []  references 
)

Variant of Filter(Comparison, float[]) where the filter output provides additional details about the comparison. This variant component is only supported starting with firmware v1.2.5. Note that if ComparisonOutput.Reference or ComparisonOutput.Zone is used, component will instead function as a

map

Parameters
opComparison operation to perform
outputOutput type the filter should produce
referencesReference values to compare against, can be multiple values if the board is on firmware v1.2.3 or later
Returns
Component representing the filter output

◆ Filter() [3/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Filter ( Comparison  op,
params string []  names 
)

Variant of the Filter(Comparison, float[]) function where the reference values are outputs from other sensors or processors

Parameters
opComparison operation to perform
namesNames identifying which sensor or processor data to use as the reference value when new values are produced
Returns
Component representing the filter output

◆ Filter() [4/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Filter ( Comparison  op,
ComparisonOutput  output,
params string []  names 
)

Variant of Filter(Comparison, ComparisonOutput, float[]) where reference values are outputs from other sensors or processors.

Parameters
opComparison operation to perform
outputOutput type of the filter
namesNames identifying which sensor or processor data to use as the reference value when new values are produced
Returns
Component representing the filter output

◆ Find() [1/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Find ( Pulse  pulse,
float  threshold,
ushort  samples 
)

Scans the input data for a pulse. When one is detected, output a summary of the scanned data

Parameters
pulseType of summary data to output
thresholdValue the sensor data must exceed for a valid pulse
samplesMinimum number of samples that must be above the threshold for a valid pulse
Returns
Component representing the output of the pulse finder

◆ Find() [2/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Find ( Threshold  threshold,
float  boundary 
)

Scans the input data for values that cross a boundary, either falling below or rising above

Parameters
thresholdType of summary data to output
boundaryThreshold boundary the data must cross
Returns
Component representing the threshold filter output

◆ Find() [3/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Find ( Threshold  threshold,
float  boundary,
float  hysteresis 
)

Variant of Find(Threshold, float) with a configurable hysteresis value for data that frequently oscillates around the threshold boundary

Parameters
thresholdType of summary data to output
boundaryThreshold boundary the data must cross
hysteresisMinimum distance between the boundary and value that indicates a successful crossing
Returns
Component representing the threshold filter output

◆ Find() [4/4]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Find ( Differential  differential,
float  distance 
)

Scans the input data for sequential data that is a minimum distance away

Parameters
differential
distance
Returns
Component representing the differential filter output

◆ Fuse()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Fuse ( params string []  bufferNames)

Combines data from multiple sources into 1 packet, available on firmware v1.4.4+.
The additional data you want to combine must first be stored into a named buffer.

Parameters
bufferNamesNamed buffer components holding the extra data to combine
Returns
Component representing the fuser output

◆ HighPass()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.HighPass ( byte  samples)

Applies a high pass filter over the input data, available on firmware v1.3.4 and later.

Parameters
samplesNumber of previous data samples to compare against
Returns
Component representing the high pass output

◆ Index()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Index ( int  i)

Gets a specific component value from the split data value

Parameters
iPosition in the split values array to return
Returns
Object representing the component value

◆ Limit() [1/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Limit ( Passthrough  type,
ushort  value 
)

Only allow data through under certain user controlled conditions

Parameters
typePassthrough operation type
valueInitial value to set the passthrough limiter to
Returns
Component representing the limiter output

◆ Limit() [2/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Limit ( uint  period)

Reduce the amount of data allowed through such that the output data rate matches the delay

Parameters
periodHow often to allow data through, in milliseconds (ms)
Returns
Component representing the output of the limiter

◆ Log() [1/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Log ( Action< IData handler)

Records the input data to the on-board logger, retrieved later when a log download is started. This component is represented by the ISubscriber interface.

Parameters
handlerHandler to process the received data
Returns
Calling object

◆ Log() [2/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Log ( )

Variant of Log(Action<IData>) that sets up the logger but does not yet assign a data handler.
The handler can be later attached with ISubscriber.Attach(Action<IData>)

Returns

◆ LowPass()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.LowPass ( byte  samples)

Applies a low pass filter over the input data, available on firmware v1.3.4 and later.

This componenet replaces the Average(byte) component.

Parameters
samplesNumber of previous data samples to compare against
Returns
Component representing the low pass output

◆ Map() [1/3]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Map ( Function1  fn)

Apply a 1 input function to all of the input data

Parameters
fnFunction to use
Returns
Component representing the mapper output

◆ Map() [2/3]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Map ( Function2  fn,
float  rhs 
)

Apply a 2 input function to all of the input data

Parameters
fnFunction to use
rhsSecond operand for the function
Returns
Component representing the mapper output

◆ Map() [3/3]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Map ( Function2  fn,
params string []  names 
)

Variant of Map(Function2, float) where the rhs value is the output of another data producer

Parameters
fnFunction to apply to the input data
namesNames identifying which producer to feed into the mapper
Returns
Component representing the mapper output

◆ Multicast()

IRouteMulticast MbientLab.MetaWear.Builder.IRouteComponent.Multicast ( )

Creates a branch in the route that direct the input data to different end points

Returns
Component for building a multicast branch

◆ Name()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Name ( string  name)

Assigns a user-defined name identifying a processor, producer, or subscriber. The name can be used to create feedback and feedforward loops, or refere to subscribers by name rather than index.

Processors and subscribers are retrieved by name with the IDataProcessor interface and IRoute.LookupSubscriber(string) method respectively.

Parameters
nameAssigned unique name to the most recent data producer (sensor or data processor)
Returns
Calling object

◆ Pack()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Pack ( byte  count)

Packs multiple input values into 1 BTLE packet. Used to reduce the number of packets broadcasted over the link.

Parameters
countNumber of input values to pack
Returns
Component representing the accounter output

◆ React()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.React ( Action< IDataToken action)

Programs the board to react in response to data being created by the most resent sensor or processor

Parameters
actionOn-board action to execute
Returns
Calling object

◆ Split()

IRouteSplit MbientLab.MetaWear.Builder.IRouteComponent.Split ( )

Separates multi-component data into its individual values

Returns
Component for building routes for component data values

◆ Stream() [1/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Stream ( Action< IData handler)

Streams the input data to the local device. This component is represented by the ISubscriber interface.

Parameters
handlerHandler to process the received data
Returns
Calling object

◆ Stream() [2/2]

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.Stream ( )

Variant of Stream(Action<IData>) that enables a data stream but does not yet assign a data handler.
The handler can be later attached with ISubscriber.Attach(Action<IData>)

Returns
Calling object

◆ To()

IRouteComponent MbientLab.MetaWear.Builder.IRouteComponent.To ( )

Signals the creation of a new multicast branch

Returns
Component from the most recent multicast component

The documentation for this interface was generated from the following file: