Class DeviceFormatters.Bcd

Namespace
ProtoTest.Devices
Assembly
ProtoTest.Devices.dll

A whole number in packed BCD, two digits per byte, most significant first: with 3 bytes, 12345 is 01 23 45. Byte order does not apply.

public abstract class DeviceFormatters.Bcd : IDeviceBinaryFieldFormatter<long>
Inheritance
DeviceFormatters.Bcd
Implements
Inherited Members
Extension Methods

Constructors

Bcd(int)

A whole number in packed BCD, two digits per byte, most significant first: with 3 bytes, 12345 is 01 23 45. Byte order does not apply.

protected Bcd(int bytes)

Parameters

bytes int

Properties

Size

Gets how many bytes the field takes.

public int Size { get; }

Property Value

int

Methods

Read(ReadOnlySpan<byte>, bool)

Reads the value from exactly Size bytes.

public long Read(ReadOnlySpan<byte> source, bool bigEndian)

Parameters

source ReadOnlySpan<byte>
bigEndian bool

Returns

long

Write(long, Span<byte>, bool)

Writes the value into exactly Size bytes.

public void Write(long value, Span<byte> destination, bool bigEndian)

Parameters

value long
destination Span<byte>
bigEndian bool