Restructure and extens tests for converter

This commit is contained in:
Peter Butzhammer
2024-02-08 10:12:13 +01:00
parent 6492d039da
commit d1ec075aa7
8 changed files with 164 additions and 131 deletions

View File

@@ -7,7 +7,7 @@ namespace Sharp7.Rx;
internal static class S7ValueConverter
{
public static TValue ConvertToType<TValue>(byte[] buffer, S7VariableAddress address)
public static TValue ReadFromBuffer<TValue>(byte[] buffer, S7VariableAddress address)
{
if (typeof(TValue) == typeof(bool))
return (TValue) (object) (((buffer[0] >> address.Bit) & 1) > 0);