fix: initialize SDK telemetry and preserve ByteString boundaries

This commit is contained in:
Joseph Doherty
2026-11-10 10:11:07 -05:00
parent efb989fe34
commit a43d20e614
3 changed files with 7 additions and 4 deletions
@@ -14,7 +14,9 @@ internal static class SdkValueBoundary
if (array.Rank != 1) throw new ArgumentException("Only one-dimensional values are supported.", nameof(value));
value = array.Clone();
}
if (byteArray && value is byte[] bytes) return Variant.From((ArrayOf<byte>)bytes);
if (value is byte[] bytes) return byteArray
? Variant.From((ArrayOf<byte>)bytes)
: Variant.From(ByteString.From(bytes));
if (VariantHelper.TryCastFrom(value, out var variant)) return variant;
throw new ArgumentException("Unsupported OPC UA value type.", nameof(value));
}