Byte Mask
Jul 19 2024 at 12:00 AM
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 Name | Description |
|---|---|
| FunctionType | The value for this function is “ByteMask”. |
| Enabled | Sets whether this Transform Function is enabled. Defaults to true. |
| Mask | A 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. |
| CompareWithMask | A 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. |
