Class CharacteristicCodecFactory
Provides reusable codecs for common characteristic value types.
public static class CharacteristicCodecFactory
- Inheritance
-
CharacteristicCodecFactory
- Inherited Members
Methods
ForBool()
Creates a codec for boolean values.
public static ICharacteristicCodec<bool, bool> ForBool()
Returns
ForByte()
Creates a codec for byte values.
public static ICharacteristicCodec<byte, byte> ForByte()
Returns
ForBytes()
Creates a pass-through codec for raw byte payloads.
public static ICharacteristicCodec<ReadOnlyMemory<byte>, ReadOnlyMemory<byte>> ForBytes()
Returns
ForChar()
Creates a codec for character values using UTF-16 little-endian encoding.
public static ICharacteristicCodec<char, char> ForChar()
Returns
ForDouble()
Creates a codec for double precision floating-point values using little-endian byte order.
public static ICharacteristicCodec<double, double> ForDouble()
Returns
ForEnum<TEnum>()
Creates a codec for enum values using the enum's underlying integral type.
public static ICharacteristicCodec<TEnum, TEnum> ForEnum<TEnum>() where TEnum : struct, Enum
Returns
- ICharacteristicCodec<TEnum, TEnum>
Type Parameters
TEnumThe enum type.
ForInt16()
Creates a codec for signed 16-bit integer values using little-endian byte order.
public static ICharacteristicCodec<short, short> ForInt16()
Returns
ForInt32()
Creates a codec for signed 32-bit integer values using little-endian byte order.
public static ICharacteristicCodec<int, int> ForInt32()
Returns
ForInt64()
Creates a codec for signed 64-bit integer values using little-endian byte order.
public static ICharacteristicCodec<long, long> ForInt64()
Returns
ForSByte()
Creates a codec for signed byte values.
public static ICharacteristicCodec<sbyte, sbyte> ForSByte()
Returns
ForSingle()
Creates a codec for single precision floating-point values using little-endian byte order.
public static ICharacteristicCodec<float, float> ForSingle()
Returns
ForString(Encoding?)
Creates a codec for strings using UTF-8 by default.
public static ICharacteristicCodec<string, string> ForString(Encoding? encoding = null)
Parameters
encodingEncodingOptional text encoding to use. Defaults to UTF-8 when null.
Returns
ForUInt16()
Creates a codec for unsigned 16-bit integer values using little-endian byte order.
public static ICharacteristicCodec<ushort, ushort> ForUInt16()
Returns
ForUInt32()
Creates a codec for unsigned 32-bit integer values using little-endian byte order.
public static ICharacteristicCodec<uint, uint> ForUInt32()
Returns
ForUInt64()
Creates a codec for unsigned 64-bit integer values using little-endian byte order.
public static ICharacteristicCodec<ulong, ulong> ForUInt64()
Returns
ForVersion()
Creates a codec for Version values using UTF-8 string serialization.
public static ICharacteristicCodec<Version, Version> ForVersion()