Link Search Menu Expand Document

Byte Mask

Jul 19 2024 at 12:00 AM

  1. Overview
  2. Installation
  3. Example Options File
  4. Property Details

Overview

This function will apply a Bitwise “& operation” to a value and the mask specified in the option.

Installation

The required NuGet Package for this function is: IoTnxt.Raptor.TransformManager

  .AddRaptorTransformManager("TransformSets", (services, configuration, builder) =>
    {
        builder.AddDefaultTransformationFunctions(services);
    })

Example Options File

{
  "TransformSets": {
    "Mask1": [
      {
        "FunctionType": "ByteMask",
        "Mask": 32,
        "CompareWithMask": true
      }
    ],
  } 
}

Property Details

Property NameDescription
FunctionTypeThe value for this function is “ByteMask”.
EnabledSets whether this Transform Function is enabled. Defaults to true.
MaskA positive or negative integer/long value with which to mask the value. Masking is applying the Bitwise “& operator” to the two values. A value of zero will always result in a 0 result.
CompareWithMaskA boolean value to indicate if the masked value should be compared with the input mask. This will try and convert the output to a boolean value, indicating whether the output value was equal to the mask value or not. Defaults to false.